tp6 swoole实现定时任务
时间: 2023-10-17 22:05:46 浏览: 180
在TP6框架中,可以使用Swoole来实现定时任务。其中,可以通过引入dragonmantank/cron-expression依赖来支持秒级的定时。具体的实现方式是通过脚本使用Swoole的定时器,通过蜕变守护进程实现常驻内存运行。这样可以避免使用swoole的server并通过workstart调用定时器的复杂性,并且在服务退出时可以正常响应信号退出。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *2* [thinkphp6+swoole实现crontab项目定时任务](https://blog.csdn.net/u010192444/article/details/126757577)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
- *3* [Swoole+ThinkPHP6自定义命令实现Mysql自动备份定时任务](https://blog.csdn.net/feiniaoflyer/article/details/118577768)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文