diff --git a/Abstracts/TraitServer.php b/Abstracts/TraitServer.php index 628b991..6932a49 100644 --- a/Abstracts/TraitServer.php +++ b/Abstracts/TraitServer.php @@ -2,6 +2,7 @@ namespace Kiri\Server\Abstracts; +use Kiri\Exception\ConfigException; use Swoole\Http\Server as HServer; use Swoole\Server; use Kiri\Server\Constant; @@ -18,12 +19,11 @@ trait TraitServer /** * @param array $class * @return void + * @throws ConfigException */ public function addProcess(array $class): void { - foreach ($class as $key => $item) { - $this->_process[] = $item; - } + $this->processManager->batch($class); } diff --git a/Server.php b/Server.php index 0f27a05..0d1c179 100644 --- a/Server.php +++ b/Server.php @@ -191,21 +191,6 @@ class Server extends HttpService } - /** - * @return void - */ - public function onSigint(): void - { - try { - $this->dispatch->dispatch(new OnBeforeShutdown()); - } catch (\Throwable $exception) { - $this->logger->error($exception->getMessage()); - } finally { - $this->manager->shutdown(); - } - } - - /** * @return void * @throws ReflectionException