summaryrefslogtreecommitdiff
path: root/includes/batch.queue.inc
diff options
context:
space:
mode:
authorwebchick <webchick@24967.no-reply.drupal.org>2012-01-21 09:15:15 -0800
committerwebchick <webchick@24967.no-reply.drupal.org>2012-01-21 09:15:15 -0800
commit767d72d48ec1b641193a072a114d0cd1ca44faf0 (patch)
treea21f37b196ba52e27b13072cec800ee8f07d37c9 /includes/batch.queue.inc
parent8ef9e8aa6e1ffa368188c42118cae36ccb507264 (diff)
downloadbrdo-767d72d48ec1b641193a072a114d0cd1ca44faf0.tar.gz
brdo-767d72d48ec1b641193a072a114d0cd1ca44faf0.tar.bz2
Issue #1315886 by xjm, jhodgdon: Clean up API docs for includes directory, files starting with A-C.
Diffstat (limited to 'includes/batch.queue.inc')
-rw-r--r--includes/batch.queue.inc35
1 files changed, 24 insertions, 11 deletions
diff --git a/includes/batch.queue.inc b/includes/batch.queue.inc
index 846483698..ed290ee70 100644
--- a/includes/batch.queue.inc
+++ b/includes/batch.queue.inc
@@ -1,24 +1,30 @@
<?php
-
/**
* @file
* Queue handlers used by the Batch API.
*
- * Those implementations:
- * - ensure FIFO ordering,
- * - let an item be repeatedly claimed until it is actually deleted (no notion
- * of lease time or 'expire' date), to allow multipass operations.
+ * These implementations:
+ * - Ensure FIFO ordering.
+ * - Allow an item to be repeatedly claimed until it is actually deleted (no
+ * notion of lease time or 'expire' date), to allow multipass operations.
*/
/**
- * Batch queue implementation.
+ * Defines a batch queue.
*
* Stale items from failed batches are cleaned from the {queue} table on cron
* using the 'created' date.
*/
class BatchQueue extends SystemQueue {
+ /**
+ * Overrides SystemQueue::claimItem().
+ *
+ * Unlike SystemQueue::claimItem(), this method provides a default lease
+ * time of 0 (no expiration) instead of 30. This allows the item to be
+ * claimed repeatedly until it is deleted.
+ */
public function claimItem($lease_time = 0) {
$item = db_query_range('SELECT data, item_id FROM {queue} q WHERE name = :name ORDER BY item_id ASC', 0, 1, array(':name' => $this->name))->fetchObject();
if ($item) {
@@ -29,9 +35,9 @@ class BatchQueue extends SystemQueue {
}
/**
- * Retrieve all remaining items in the queue.
+ * Retrieves all remaining items in the queue.
*
- * This is specific to Batch API and is not part of the DrupalQueueInterface,
+ * This is specific to Batch API and is not part of the DrupalQueueInterface.
*/
public function getAllItems() {
$result = array();
@@ -44,10 +50,17 @@ class BatchQueue extends SystemQueue {
}
/**
- * Batch queue implementation used for non-progressive batches.
+ * Defines a batch queue for non-progressive batches.
*/
class BatchMemoryQueue extends MemoryQueue {
+ /**
+ * Overrides MemoryQueue::claimItem().
+ *
+ * Unlike MemoryQueue::claimItem(), this method provides a default lease
+ * time of 0 (no expiration) instead of 30. This allows the item to be
+ * claimed repeatedly until it is deleted.
+ */
public function claimItem($lease_time = 0) {
if (!empty($this->queue)) {
reset($this->queue);
@@ -57,9 +70,9 @@ class BatchMemoryQueue extends MemoryQueue {
}
/**
- * Retrieve all remaining items in the queue.
+ * Retrieves all remaining items in the queue.
*
- * This is specific to Batch API and is not part of the DrupalQueueInterface,
+ * This is specific to Batch API and is not part of the DrupalQueueInterface.
*/
public function getAllItems() {
$result = array();