thinkphp队列queue的一些使用说明,queue:work和queue:listen的区别

获取帮助

php think queue:work --help
Usage:
queue:work [options]
Options:
--queue[=QUEUE] The queue to listen on
--daemon Run the worker in daemon mode
--delay[=DELAY] Amount of time to delay failed jobs [default: 0]
--force Force the worker to run even in maintenance mode
--memory[=MEMORY] The memory limit in megabytes [default: 128]
--sleep[=SLEEP] Number of seconds to sleep when no job is available [default: 3]
--tries[=TRIES] Number of times to attempt a job before logging it failed [default: 0]
-h, --help Display this help message
-V, --version Display this console version
-q, --quiet Do not output any message
--ansi Force ANSI output
--no-ansi Disable ANSI output
-n, --no-interaction Do not ask any interactive question
-v|vv|vvv, --verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

php think queue:+指令

queue:restart 队列重启
queue:work 队列执行
queue:listen 队列监听
queue:subscribe 队列订阅

后台遍历执行:

php think queue:work --daemon
#或者
php think queue:listen

queue:work --daemon和queue:listen的区别

queue:work --daemon 在修改job下面的代码后需要重启服务,利用的是缓存方式(相当于常驻内存),速度非常高效!!!推荐。
queue:listen 修改job下面代码实时生效,每次都会重新载入框架,相对来说更消耗性能,调试时使用或者不行经常重启时采用
posted @   bilzzard  阅读(2794)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· DeepSeek 开源周回顾「GitHub 热点速览」
· 记一次.NET内存居高不下排查解决与启示
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
点击右上角即可分享
微信分享提示