From a90e647529f7198bcdddb0ade4082b64a9b6e943 Mon Sep 17 00:00:00 2001 From: "as2252258@163.com" Date: Mon, 3 May 2021 00:43:38 +0800 Subject: [PATCH] modify --- System/Async.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/System/Async.php b/System/Async.php index b95c5d6c..e926f416 100644 --- a/System/Async.php +++ b/System/Async.php @@ -26,7 +26,7 @@ class Async extends Component */ public function addAsync(string $name, Task $handler) { - $this->_absences[$name] = $handler; + $this->_absences[$name] = $handler::class; } @@ -47,7 +47,7 @@ class Async extends Component } /** @var Task $class */ - $class = $this->_absences[$name]; + $class = new $this->_absences[$name](); $class->setParams($params); $randWorkerId = random_int(0, $server->setting['task_worker_num'] - 1);