From 335be2ed9c0d2c295f30a3c34d2b04def8996892 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Tue, 19 Jan 2021 18:47:38 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- System/Abstracts/Pool.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/System/Abstracts/Pool.php b/System/Abstracts/Pool.php index 96fdbd45..506fe617 100644 --- a/System/Abstracts/Pool.php +++ b/System/Abstracts/Pool.php @@ -126,6 +126,12 @@ abstract class Pool extends Component } Context::setContext('create:connect:' . $coroutineName, 1); + $client = call_user_func($createHandler, ...$config); + if (!Context::inCoroutine()) { + Context::deleteId('create:connect:' . $coroutineName); + return $client; + } + $this->push($coroutineName, call_user_func($createHandler, ...$config)); Context::deleteId('create:connect:' . $coroutineName);