eee
This commit is contained in:
@@ -71,7 +71,9 @@ class AsyncServer extends Component implements ServerInterface
|
||||
* @param array $service
|
||||
* @param int $daemon
|
||||
* @return array
|
||||
* @throws ContainerExceptionInterface
|
||||
* @throws NotFindClassException
|
||||
* @throws NotFoundExceptionInterface
|
||||
*/
|
||||
private function createBaseServer(array $service, int $daemon = 0): array
|
||||
{
|
||||
|
||||
@@ -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']);
|
||||
|
||||
@@ -48,7 +48,7 @@ trait TraitProcess
|
||||
private function genProcess(AbstractProcess $name): Process
|
||||
{
|
||||
return new Process(function (Process $process) use ($name) {
|
||||
$process->name('[' . \config('id', 'system-service') . '].' . $name->getName());
|
||||
$process->name('[' . \config('id', 'system-service') . '].' . $name->getName()) . '.' . $process->pid;
|
||||
$name->onShutdown($process)->process($process);
|
||||
},
|
||||
$name->getRedirectStdinAndStdout(),
|
||||
|
||||
Reference in New Issue
Block a user