From edd1751f7adac55a9ca1bb0f3f5a75fe9153ef2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=91=E6=9E=97?= Date: Thu, 8 Sep 2022 14:07:22 +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 --- Client.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Client.php b/Client.php index 94fe343..1be4bba 100644 --- a/Client.php +++ b/Client.php @@ -2,7 +2,7 @@ namespace Kiri; -use Kiri\Context; +use Swoole\Coroutine; /** @@ -12,7 +12,7 @@ class Client { - private CoroutineClient|CurlClient|AsyncClient $abstracts; + private CoroutineClient|CurlClient $abstracts; /** @@ -22,7 +22,7 @@ class Client */ public function __construct(string $host, int $port, bool $isSsl = false) { - if (Context::inCoroutine()) { + if (class_exists(Coroutine::class) && Coroutine::getCid() > -1) { $this->abstracts = new CoroutineClient($host, $port, $isSsl); } else { $this->abstracts = new CurlClient($host, $port, $isSsl);