改名
This commit is contained in:
@@ -79,7 +79,6 @@ class OnTask extends Callback
|
|||||||
}
|
}
|
||||||
|
|
||||||
$finish = $this->runTaskHandler($task->data);
|
$finish = $this->runTaskHandler($task->data);
|
||||||
Coroutine::getContext()['isComplete'] = true;
|
|
||||||
if (!$finish) {
|
if (!$finish) {
|
||||||
$finish = [];
|
$finish = [];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -63,15 +63,8 @@ class OnWorkerStart extends Callback
|
|||||||
if ($sigkill === false) {
|
if ($sigkill === false) {
|
||||||
return $server->stop($workerId);
|
return $server->stop($workerId);
|
||||||
}
|
}
|
||||||
while (true) {
|
while ($server->stats()['coroutine_num'] > 0) {
|
||||||
$context = Coroutine::getContext(Coroutine::getPcid());
|
Coroutine::sleep(0.01);
|
||||||
if (!isset($context['isComplete'])) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
$content = $context['isComplete'];
|
|
||||||
if ($content === true) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return $server->stop($workerId);
|
return $server->stop($workerId);
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user