Drupal difference between DatabaseQueue and BatchQueue

Viewed 209
1 Answers

From the source of Batch.php:

/**
 * Defines a batch queue handler used by the Batch API.
 *
 * This implementation:
 * - Ensures FIFO ordering.
 * - Allows an item to be repeatedly claimed until it is actually deleted (no
 *   notion of lease time or 'expire' date), to allow multipass operations.
 *
 * Stale items from failed batches are cleaned from the {queue} table on cron
 * using the 'created' date.
 *
 * @ingroup queue
 */
 class Batch extends DatabaseQueue {

Batch extends DatabaseQueue. In my experience, batch is most often used with a form, as it will automatically process the batch after it's built.

  • Yes, FIFO.
  • No, items don't expire.
  • And yes, serial processing.
Related