You are here

class Redis_Queue in Redis 7.2

Same name and namespace in other branches
  1. 7.3 lib/Redis/Queue.php \Redis_Queue

Hierarchy

Expanded class hierarchy of Redis_Queue

File

lib/Redis/Queue.php, line 3

View source
class Redis_Queue implements DrupalReliableQueueInterface {

  /**
   * @var DrupalQueueInterface
   */
  protected $backend;

  /**
   * Default contructor
   *
   * Beware that DrupalQueueInterface does not defines the __construct
   * method in the interface yet is being used from DrupalQueue::get()
   *
   * @param unknown $name
   */
  public function __construct($name) {
    $className = Redis_Client::getClass(Redis_Client::REDIS_IMPL_QUEUE);
    $this->backend = new $className($name);
  }
  public function createItem($data) {
    return $this->backend
      ->createItem($data);
  }
  public function numberOfItems() {
    return $this->backend
      ->numberOfItems();
  }
  public function claimItem($lease_time = 3600) {
    return $this->backend
      ->claimItem($lease_time);
  }
  public function deleteItem($item) {
    return $this->backend
      ->deleteItem($item);
  }
  public function releaseItem($item) {
    return $this->backend
      ->releaseItem($item);
  }
  public function createQueue() {
    return $this->backend
      ->createQueue();
  }
  public function deleteQueue() {
    return $this->backend
      ->deleteQueue();
  }

}

Members

Namesort descending Modifiers Type Description Overrides
Redis_Queue::$backend protected property
Redis_Queue::claimItem public function Claim an item in the queue for processing. Overrides DrupalQueueInterface::claimItem
Redis_Queue::createItem public function Add a queue item and store it directly to the queue. Overrides DrupalQueueInterface::createItem
Redis_Queue::createQueue public function Create a queue. Overrides DrupalQueueInterface::createQueue
Redis_Queue::deleteItem public function Delete a finished item from the queue. Overrides DrupalQueueInterface::deleteItem
Redis_Queue::deleteQueue public function Delete a queue and every item in the queue. Overrides DrupalQueueInterface::deleteQueue
Redis_Queue::numberOfItems public function Retrieve the number of items in the queue. Overrides DrupalQueueInterface::numberOfItems
Redis_Queue::releaseItem public function Release an item that the worker could not process, so another worker can come in and process it before the timeout expires. Overrides DrupalQueueInterface::releaseItem
Redis_Queue::__construct public function Default contructor