You are here

public function Redis_Queue_PhpRedis::releaseItem in Redis 7.2

Same name and namespace in other branches
  1. 7.3 lib/Redis/Queue/PhpRedis.php \Redis_Queue_PhpRedis::releaseItem()

Release an item that the worker could not process, so another worker can come in and process it before the timeout expires.

Parameters

$item:

Return value

boolean

Overrides DrupalQueueInterface::releaseItem

File

lib/Redis/Queue/PhpRedis.php, line 83

Class

Redis_Queue_PhpRedis
@todo Set high expire value to the hash for rotation when memory is empty React upon cache clear all and rebuild path list?

Code

public function releaseItem($item) {
  $pipe = $this
    ->getClient()
    ->multi(Redis::PIPELINE);
  $pipe
    ->lrem($this
    ->getKeyForClaimed(), $item->qid, -1);
  $pipe
    ->lpush($this
    ->getKeyForQueue(), $item->qid);
  $ret = $pipe
    ->exec();
  return $ret[0] && $ret[1];
}