经常使用linux的同学们应该对使用宝塔来做队列监听一定非常熟悉,但对于windows系统下,如何去做队列的监听?是一个很麻烦的事情。
本文将通过windows系统的服务来实现队列的监听。
对于thinkphp6 queue如何使用,不再赘述。其它系统也一样,先看效果。

队列日志输出.

服务常驻。
方法:
下载nssm。
下载地址:
官网:NSSM - the Non-Sucking Service Manager
百度网盘:百度网盘 请输入提取码
使用方法介绍:https://www.cnblogs.com/fps2tao/p/16433588.html


用管理员权限打开命令行,找到nssm路径,输入 nssm install,如上图:
path 找到你php.exe的具体路径,不建议路径中有中文。
第2行是自动的。
第三行参数输入你站点的完整路径加think queue:listen,如下图:
d:\phpstudy_pro\www\think queue:listen

然后输入一个服务名称,安装服务。即会在你的系统服务里看到了个服务项目。如下图:

然后启动这个服务。
当你在代码里执行了队列,便会自动执行。实现长期监听。

完。