eee
This commit is contained in:
@@ -71,7 +71,9 @@ class AsyncServer extends Component implements ServerInterface
|
|||||||
* @param array $service
|
* @param array $service
|
||||||
* @param int $daemon
|
* @param int $daemon
|
||||||
* @return array
|
* @return array
|
||||||
|
* @throws ContainerExceptionInterface
|
||||||
* @throws NotFindClassException
|
* @throws NotFindClassException
|
||||||
|
* @throws NotFoundExceptionInterface
|
||||||
*/
|
*/
|
||||||
private function createBaseServer(array $service, int $daemon = 0): array
|
private function createBaseServer(array $service, int $daemon = 0): array
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -125,6 +125,13 @@ abstract class AbstractProcess implements OnProcessInterface
|
|||||||
{
|
{
|
||||||
$this->process = $process;
|
$this->process = $process;
|
||||||
if ($this->enable_coroutine) {
|
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());
|
Coroutine::create(fn () => $this->coroutineWaitSignal());
|
||||||
} else {
|
} else {
|
||||||
pcntl_signal(SIGTERM, [$this, 'pointWaitSignal']);
|
pcntl_signal(SIGTERM, [$this, 'pointWaitSignal']);
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ trait TraitProcess
|
|||||||
private function genProcess(AbstractProcess $name): Process
|
private function genProcess(AbstractProcess $name): Process
|
||||||
{
|
{
|
||||||
return new Process(function (Process $process) use ($name) {
|
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->onShutdown($process)->process($process);
|
||||||
},
|
},
|
||||||
$name->getRedirectStdinAndStdout(),
|
$name->getRedirectStdinAndStdout(),
|
||||||
|
|||||||
Reference in New Issue
Block a user