You are here

public function ReliablePhpRedis::releaseItem in Redis 8

Releases an item that the worker could not process.

Another worker can come in and process it before the timeout expires.

Parameters

$item: The item returned by \Drupal\Core\Queue\QueueInterface::claimItem().

Return value

bool TRUE if the item has been released, FALSE otherwise.

Overrides QueueInterface::releaseItem

File

src/Queue/ReliablePhpRedis.php, line 104

Class

ReliablePhpRedis
Redis queue implementation using PhpRedis extension backend.

Namespace

Drupal\redis\Queue

Code

public function releaseItem($item) {
  $this->client
    ->multi()
    ->lrem($this->claimedListKey, $item->qid, -1)
    ->lpush($this->availableListKey, $item->qid)
    ->exec();
}