前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >Laravle Queue命令

Laravle Queue命令

作者头像
苦咖啡
发布2018-04-28 13:24:40
7080
发布2018-04-28 13:24:40
举报
文章被收录于专栏:我的博客我的博客
代码语言:javascript
复制
php artisan queue:work --help
Usage:
  queue:work [options] [--] [<connection>]

Arguments:
  connection             队列连接redis、database等

Options:
      --queue[=QUEUE]    队列任务
      --daemon           后台执行
      --delay[=DELAY]    任务执行失败之后延迟多久重试
      --force            Force the worker to run even in maintenance mode
      --memory[=MEMORY]  The memory limit in megabytes [default: 128]
      --sleep[=SLEEP]    队列无可用任务休息时间间隔,默认3s
      --tries[=TRIES]    失败任务最多重试次数 [default: 0]
  -h, --help             输出帮助信息
  -q, --quiet            不输出信息
  -V, --version          Display this application version
      --ansi             Force ANSI output
      --no-ansi          Disable ANSI output
  -n, --no-interaction   Do not ask any interactive question
      --env[=ENV]        The environment the command should run under.
  -v|vv|vvv, --verbose   Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
使用案例
php artisan queue:work redis --queue=recommend --daemon --tries=1
备注:
queue:work 默认只执行一次队列请求, 当请求执行完成后就终止;
queue:listen 监听队列请求, 只要运行着, 就能一直接受请求, 除非手动终止;
queue:work --daemon 同 listen 一样, 只要运行着, 就能一直接受请求, 不一样的地方是在这个运行模式下, 当新的请求到来的时候, 不重新加载整个框架, 而是直接 fire 动作.
能看出来, queue:work --daemon 是最高级的, 一般推荐使用这个来处理队列监听.

注意: 使用 queue:work --daemon , 当更新代码的时候, 需要停止, 然后重新启动, 这样才能把修改的代码应用上.
因此开发环境建议用queue:listen


php artisan queue:listen --help
Usage:
  queue:listen [options] [--] [<connection>]

Arguments:
  connection               The name of connection

Options:
      --queue[=QUEUE]      The queue to listen on
      --delay[=DELAY]      Amount of time to delay failed jobs [default: 0]
      --memory[=MEMORY]    The memory limit in megabytes [default: 128]
      --timeout[=TIMEOUT]  Seconds a job may run before timing out [default: 60]
      --sleep[=SLEEP]      Seconds to wait before checking queue for jobs [default: 3]
      --tries[=TRIES]      Number of times to attempt a job before logging it failed [default: 0]
  -h, --help               Display this help message
  -q, --quiet              Do not output any message
  -V, --version            Display this application version
      --ansi               Force ANSI output
      --no-ansi            Disable ANSI output
  -n, --no-interaction     Do not ask any interactive question
      --env[=ENV]          The environment the command should run under.
  -v|vv|vvv, --verbose     Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug
本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2017年5月27日,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档