
workerman 不能关闭怎么办?
问题:启动脚本里执行Worker::stopAll()并不能停止workerman,Worker::stopAll()只有在运行workerman的主进程里执行才有效,外部其它进程执行没有效果。
停止Workerman的流程是
1、找到Workerman主进程pid
2、给pid发送SIGINT信号(posix_kill(SIGINT, pid))
3、workerman主进程收到SIGINT信号后自身执行Worker::stopAll()完成服务停止。
这三个步骤workerman内部应封装好,调用流程是
1、设置$argv = 'stop';
2、运行Worker::runAll();
推荐:workerman教程
以上就是workerman 不能关闭怎么办的详细内容,更多请关注php中文网其它相关文章!
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号