Tasks Queuing 本文未发布 发布文章

未匹配的标注

Tasks Queuing

Tasks Queuing:

  • Queues System, which executes the Jobs classes one by one once he receives it or once it’s scheduled (after being serialized and stored in a string somewhere).
  • to be able to queue the Jobs you need a Queuing System such as Beanstalkd, Redis, Amazon SQS or simply the DB.
  • Laravel has a “queue worker” that will process new Jobs as they are pushed onto the queue system, (“queue:work” and “queue:listen”). It’s job is to push the jobs to the queue system in order to be executed.
  • to keep the “queue worker “queue:work” artisan command, running permanently in the background, you should use a process monitor such as “Supervisor” to ensure that the queue worker does not stop running. It will simply make sure to execute the “php artisan queue:work” command.
  • so its role is to schedule the execution of Artisan Command, Jobs, Event Listeners, and some other classes, at specific intervals or dates using the third party Queueing System.
    More info here (docs).
    The only addition to the Laravel’s queues in Apiato, is that by default, apiato detects which queue driver you are planning to use (based on the configs), to create the migration files required, in case type database is used.
if (Config::get('queue.default') == 'database')
{
   // do something
}

(refer to app/Ship/Migrations/ folder for more details).

Beanstalkd

In order to use Beanstalkd as your queue driver, you need to require the "pda/pheanstalk": "^3.1" package first. You can include this in any composer.json file you want.

本文章首发在 LearnKu.com 网站上。

上一篇 下一篇
《L04 微信小程序从零到发布》
从小程序个人账户申请开始,带你一步步进行开发一个微信小程序,直到提交微信控制台上线发布。
《G01 Go 实战入门》
从零开始带你一步步开发一个 Go 博客项目,让你在最短的时间内学会使用 Go 进行编码。项目结构很大程度上参考了 Laravel。
讨论数量: 0
发起讨论 只看当前版本


暂无话题~