【发布时间】:2017-09-16 17:08:02
【问题描述】:
我有一个 Web 应用程序,我想让我们使用队列进行后台处理。阅读文档后,我似乎无法理解如何创建队列
到目前为止,我是这样理解的。
创建一个工作类来完成这项工作
php artisan make:job Background
向队列分派作业
$job = (new ProcessPodcast($podcast))->onQueue('processing');
dispatch($job);
//This adds the job to the queue named processing
监听给定的队列
php artisan queue:listen --memory=512 --queue=processing
最后,有什么区别
php artisan make:job SendReminderEmail --queued
和php artisan make:job SendReminderEmail
如何使用我选择的名称创建队列?
【问题讨论】: