This commit is contained in:
2021-03-01 17:46:10 +08:00
parent eb3ba3b94b
commit d6622a2b0b
+4 -1
View File
@@ -92,18 +92,21 @@ class OnWorkerStart extends Callback
* @param $worker_id * @param $worker_id
* @return mixed * @return mixed
*/ */
public function onSignal(Server $server, $worker_id): mixed public function onSignal(Server $server, $worker_id): void
{ {
$ret = Coroutine::waitSignal($this->signal, -1); $ret = Coroutine::waitSignal($this->signal, -1);
Coroutine\go(function ($ret, $server, $worker_id) {
if ($ret === true) { if ($ret === true) {
$this->ticker(); $this->ticker();
} }
return $server->stop($worker_id); return $server->stop($worker_id);
}, $ret, $server, $worker_id);
} }
/** /**
* @return void * @return void
* @throws ComponentException
*/ */
private function ticker(): void private function ticker(): void
{ {