This commit is contained in:
xl
2024-09-04 10:51:16 +08:00
parent e6c051ad24
commit 90154ece54
3 changed files with 10 additions and 1 deletions
+7
View File
@@ -125,6 +125,13 @@ abstract class AbstractProcess implements OnProcessInterface
{
$this->process = $process;
if ($this->enable_coroutine) {
Coroutine::set([
'enable_deadlock_check' => false,
'deadlock_check_disable_trace' => false,
'exit_condition' => function () {
return Coroutine::stats()['coroutine_num'] === 0;
}
]);
Coroutine::create(fn () => $this->coroutineWaitSignal());
} else {
pcntl_signal(SIGTERM, [$this, 'pointWaitSignal']);