如何解决DatabaseQueue和BatchQueue之间的Drupal差异
看看Drupal queue documentation,尚不清楚DatabaseQueue和BatchQueue之间有什么区别?都是FIFO吗?他们会过期吗?序列的意思不是并发处理?
解决方法
从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
最常与表单一起使用,因为它将在生成批次后自动处理该批次。
- 是的,FIFO。
- 不,项目不会过期。
- 是的,串行处理。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。