Queue::push('SendEmail@send',array('message'=>$message)); Specifying The Queue / Tube For A Job* You may also specify the queue / tube a job should be sent to: Queue::push('SendEmail@send',array('message'=>$message),'emails'); ...
Any overlapping jobs will be released back to the queue. You may also specify the number of seconds that must elapse before the released job will be attempted again:/** * Get the middleware the job should pass through. * * @return array */ public function middleware() { return [(new ...
Keep in mind, this does not push jobs to different queue "connections" as defined by your queue configuration file, but only to specific queues within a single connection. To specify the queue, use the onQueue method when dispatching the job:...
However, you may specify the number of minutes such a job should be delayed by calling the backoff method when attaching the middleware to the job:use Illuminate\Queue\Middleware\ThrottlesExceptions;/** * Get the middleware the job should pass through. * * @return array<int, object> */...
However, pushing jobs to multiple queues can be especially useful for applications that wish to prioritize or segment how jobs are processed, since the Laravel queue worker allows you to specify which queues it should process by priority. For example, if you push jobs to a high queue, you ...
However, you may specify the number of minutes such a job should be delayed by calling the backoff method when attaching the middleware to the job:use Illuminate\Queue\Middleware\ThrottlesExceptions; /** * Get the middleware the job should pass through. * * @return array */ public function...
If we don’t specify the name of the queue where we want to dispatch the job, Laravel will just send them to the default queue. But we can also send each type of jobs to a specific job. // This job is sent to the default queue... ...
因此在正式环境中我们更倾向于使用多个queue:work并行执行异步队列中的任务。queue:work只是读取队首的一项任务,执行完成后即结束程序,如果没有任务也会结束程序。这个方式类似于PHP对于WEB请求的处理,不会出现内存泄露。 利用Supervisor可以便捷的创建基于queue:work的异步队列并行处理。
php artisan queue:work--tries=3 不过,你还可以在任务类自身定义最大失败次数来实现更加细粒度的控制,如果最大失败次数在任务中指定,则其优先级高于命令行指定的数值: 代码语言:javascript 复制 <?php namespace App\Jobs;classProcessPodcastimplementsShouldQueue{/** ...
apollo-namespaces The namespace to which the APP belongs, support specify the multiple application --apollo-namespaces=application --apollo-namespaces=env apollo-cluster The cluster to which the APP belongs default --apollo-cluster=default apollo-client-ip IP of current instance, can also be used ...