DatabaseQueue 和 BatchQueue 之间的区别

Drupal difference between DatabaseQueue and BatchQueue

正在查看 Drupal queue documentation it is not clear what the difference is between a DatabaseQueue and a BatchQueue?两者都是先进先出吗?它们会过期吗?串行意味着不是并发处理?

来源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 {

批处理扩展了 DatabaseQueue。根据我的经验,batch 最常与表单一起使用,因为它会在构建后自动处理批处理。

  • 是的,先进先出。
  • 不,物品不会过期。
  • 是的,串行处理。