加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 大数据 > 正文

php – Laravel使用不同的队列连接来调度Jobs

发布时间:2020-12-14 19:38:33 所属栏目:大数据 来源:网络整理
导读:我正在使用laravel 5.1,我正在使用调度方法将作业推送到队列中. 但有两种工作,我已经创建了两个队列,并在sqs中有两个队列. 我该怎么做到这一点? 这对我有用. //code to be used in the controller (taken from @jedrzej.kurylo above)$job = (new SendRemin
我正在使用laravel 5.1,我正在使用调度方法将作业推送到队列中.
但有两种工作,我已经创建了两个队列,并在sqs中有两个队列.
我该怎么做到这一点?
这对我有用.
//code to be used in the controller (taken from @jedrzej.kurylo above)
$job = (new SendReminderEmail($user))->onQueue('emails');
$this->dispatch($job);

我认为这会将作业发送到名为“emails”的队列.
要执行在“电子邮件”队列中分派的作业:

//Run this command in a new terminal window
php artisan queue:listen --queue=emails

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读