diff --git a/core/lib/Drupal/Core/Queue/Memory.php b/core/lib/Drupal/Core/Queue/Memory.php index 125d146..54a4f65 100644 --- a/core/lib/Drupal/Core/Queue/Memory.php +++ b/core/lib/Drupal/Core/Queue/Memory.php @@ -31,6 +31,8 @@ class Memory implements QueueInterface { */ protected $id_sequence; + /* Implementations of Drupal\Core\Queue\QueueInterface. */ + public function __construct($name) { $this->queue = array(); $this->id_sequence = 0; diff --git a/core/lib/Drupal/Core/Queue/QueueInterface.php b/core/lib/Drupal/Core/Queue/QueueInterface.php index 3b0b35f..90d4b00 100644 --- a/core/lib/Drupal/Core/Queue/QueueInterface.php +++ b/core/lib/Drupal/Core/Queue/QueueInterface.php @@ -23,10 +23,11 @@ interface QueueInterface { public function __construct($name); /** - * Add a queue item and store it directly to the queue. + * Adds a queue item and store it directly to the queue. * * @param $data * Arbitrary data to be associated with the new task in the queue. + * * @return * TRUE if the item was successfully created and was (best effort) added * to the queue, otherwise FALSE. We don't guarantee the item was @@ -36,7 +37,7 @@ interface QueueInterface { public function createItem($data); /** - * Retrieve the number of items in the queue. + * Retrieves the number of items in the queue. * * This is intended to provide a "best guess" count of the number of items in * the queue. Depending on the implementation and the setup, the accuracy of @@ -52,7 +53,7 @@ interface QueueInterface { public function numberOfItems(); /** - * Claim an item in the queue for processing. + * Claims an item in the queue for processing. * * @param $lease_time * How long the processing is expected to take in seconds, defaults to an @@ -63,6 +64,7 @@ interface QueueInterface { * run more than once (non-idempotent), a larger lease time will make it * more rare for a given task to run multiple times in cases of failure, * at the cost of higher latency. + * * @return * On success we return an item object. If the queue is unable to claim an * item it returns false. This implies a best effort to retrieve an item @@ -72,7 +74,7 @@ interface QueueInterface { public function claimItem($lease_time = 3600); /** - * Delete a finished item from the queue. + * Deletes a finished item from the queue. * * @param $item * The item returned by Drupal\Core\Queue\QueueInterface::claimItem(). @@ -80,16 +82,20 @@ interface QueueInterface { public function deleteItem($item); /** - * Release an item that the worker could not process, so another - * worker can come in and process it before the timeout expires. + * Releases an item that the worker could not process. + * + * Another worker can come in and process it before the timeout expires. * * @param $item + * The item returned by Drupal\Core\Queue\QueueInterface::claimItem(). + * * @return boolean + * TRUE if the item has been released, FALSE otherwise. */ public function releaseItem($item); /** - * Create a queue. + * Creates a queue. * * Called during installation and should be used to perform any necessary * initialization operations. This should not be confused with the @@ -102,7 +108,7 @@ interface QueueInterface { public function createQueue(); /** - * Delete a queue and every item in the queue. + * Deletes a queue and every item in the queue. */ public function deleteQueue(); } diff --git a/core/lib/Drupal/Core/Queue/System.php b/core/lib/Drupal/Core/Queue/System.php index bc4d68e..f89f98b 100644 --- a/core/lib/Drupal/Core/Queue/System.php +++ b/core/lib/Drupal/Core/Queue/System.php @@ -18,6 +18,8 @@ class System implements ReliableQueueInterface { */ protected $name; + /* Implementations of Drupal\Core\Queue\ReliableQueueInterface. */ + public function __construct($name) { $this->name = $name; }