swoole / swoole-src

🚀 Coroutine-based concurrency library for PHP
https://www.swoole.com
Apache License 2.0
18.46k stars 3.16k forks source link

自定义进程中不能监听到信号 #5563

Closed chenjian-cpu closed 3 days ago

chenjian-cpu commented 5 days ago
微信图片_20241115234358

如图所示,我直接kill -15 pid,没有任何输出,进程也没有被kill, 帮忙看下是不是使用的方式不对?

NathanFreeman commented 4 days ago

需要设置$http->set(['hook_flags' => SWOOLE_HOOK_ALL]);,否则sleep是阻塞函数,会导致信号的回调函数无法执行。