read(); } } /** * @return $this */ public function onSigterm(): static { // TODO: Implement onSigterm() method. if (Context::inCoroutine()) { Coroutine::create(fn() => $this->onShutdown(Coroutine::waitSignal(SIGTERM | SIGINT))); } else { pcntl_signal(SIGTERM, [$this, 'onStop']); pcntl_signal(SIGINT, [$this, 'onStop']); } return $this; } }