From 6e43e9319a0c7385197a0e3731fef61a19855093 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=91=E6=9E=97?= Date: Tue, 4 Apr 2023 13:56:42 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=98=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Server.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Server.php b/Server.php index a5fd186..eee81f1 100644 --- a/Server.php +++ b/Server.php @@ -42,6 +42,9 @@ class Server extends HttpService private mixed $daemon = 0; + public AsyncServer $manager; + + /** * @param State $state * @param AsyncServer $manager @@ -54,7 +57,6 @@ class Server extends HttpService * @throws Exception */ public function __construct(public State $state, - public AsyncServer $manager, public ContainerInterface $container, public ProcessManager $processManager, public EventDispatch $dispatch, @@ -69,9 +71,13 @@ class Server extends HttpService /** * @return void * @throws ConfigException + * @throws ContainerExceptionInterface + * @throws NotFoundExceptionInterface */ public function init(): void { + $this->manager = $this->container->get(Config::get('server.class',AsyncServer::class)); + $enable_coroutine = Config::get('server.settings.enable_coroutine', false); if (!$enable_coroutine) { return;