You are here

interface AcquiaPurgeQueueInterface in Acquia Purge 7

DrupalReliableQueueInterface derivative supporting efficient storage models.

Hierarchy

Expanded class hierarchy of AcquiaPurgeQueueInterface

All classes that implement AcquiaPurgeQueueInterface

See also

DrupalReliableQueueInterface()

http://github.com/nielsvm/purge/blob/8.x-3.x/src/Queue/PluginInterface.php

File

lib/queue/AcquiaPurgeQueueInterface.php, line 14
Contains AcquiaPurgeQueueInterface.

View source
interface AcquiaPurgeQueueInterface extends DrupalReliableQueueInterface {

  /**
   * Construct a queue object.
   *
   * @param AcquiaPurgeStateStorageInterface $state
   *   The state storage required for the queue counters.
   */
  public function __construct(AcquiaPurgeStateStorageInterface $state);

  /**
   * Retrieve the failed purges counter.
   *
   * @return AcquiaPurgeStateCounterInterface
   *   The counter.
   */
  public function bad();

  /**
   * Retrieve the successful purges counter.
   *
   * @return AcquiaPurgeStateCounterInterface
   *   The counter.
   */
  public function good();

  /**
   * Retrieve the total queue items counter.
   *
   * @return AcquiaPurgeStateCounterInterface
   *   The counter.
   */
  public function total();

  /**
   * Add multiple items to the queue and store them efficiently.
   *
   * @param array $items
   *   Non-associative array containing arrays with arbitrary data to be
   *   associated with the new tasks in the queue.
   *
   * @return true|false
   *   TRUE if all items got created successfully, or FALSE if just one of them
   *   failed being created.
   */
  public function createItemMultiple(array $items);

  /**
   * Claims multiple items from the queue for processing.
   *
   * @param int $claims
   *   Determines how many claims at once should be claimed from the queue. When
   *   the queue is unable to return as many items as requested it will return
   *   as much items as it can.
   * @param int $lease_time
   *   How long the processing is expected to take in seconds, defaults to an
   *   hour. After this lease expires, the item will be reset and another
   *   consumer can claim the item. For idempotent tasks (which can be run
   *   multiple times without side effects), shorter lease times would result
   *   in lower latency in case a consumer fails. For tasks that should not be
   *   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 AcquiaPurgeInvalidationInterface[]
   *   On success we return a non-associative array with item objects. When the
   *   queue has no items that can be claimed, this doesn't return FALSE as
   *   claimItem() does, but an empty array instead.
   *
   *   If claims return, the objects have at least these properties:
   *   - data: the same as what what passed into createItem().
   *   - item_id: the unique ID returned from createItem().
   *   - created: timestamp when the item was put into the queue.
   */
  public function claimItemMultiple($claims = 10, $lease_time = 3600);

  /**
   * Delete multiple items from the queue at once.
   *
   * @param array $items
   *   Non-associative array with item objects as returned by
   *   claimItemMultiple() or DrupalQueueInterface::claimItem().
   */
  public function deleteItemMultiple(array $items);

  /**
   * Release multiple items that the worker could not process.
   *
   * Another worker can come in and process these before the timeout expires.
   *
   * @param array $items
   *   Non-associative array with item objects as returned by
   *   claimItemMultiple() or DrupalQueueInterface::claimItem().
   *
   * @return array
   *   Empty array upon full success, else the remaining items that failed.
   */
  public function releaseItemMultiple(array $items);

}

Members

Namesort descending Modifiers Type Description Overrides
AcquiaPurgeQueueInterface::bad public function Retrieve the failed purges counter. 1
AcquiaPurgeQueueInterface::claimItemMultiple public function Claims multiple items from the queue for processing. 1
AcquiaPurgeQueueInterface::createItemMultiple public function Add multiple items to the queue and store them efficiently. 1
AcquiaPurgeQueueInterface::deleteItemMultiple public function Delete multiple items from the queue at once. 1
AcquiaPurgeQueueInterface::good public function Retrieve the successful purges counter. 1
AcquiaPurgeQueueInterface::releaseItemMultiple public function Release multiple items that the worker could not process. 1
AcquiaPurgeQueueInterface::total public function Retrieve the total queue items counter. 1
AcquiaPurgeQueueInterface::__construct public function Construct a queue object.
DrupalQueueInterface::claimItem public function Claim an item in the queue for processing. 2
DrupalQueueInterface::createItem public function Add a queue item and store it directly to the queue. 2
DrupalQueueInterface::createQueue public function Create a queue. 2
DrupalQueueInterface::deleteItem public function Delete a finished item from the queue. 2
DrupalQueueInterface::deleteQueue public function Delete a queue and every item in the queue. 2
DrupalQueueInterface::numberOfItems public function Retrieve the number of items in the queue. 2
DrupalQueueInterface::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. 2