This commit is contained in:
as2252258@163.com
2021-04-24 20:34:35 +08:00
parent 3ffd691b4a
commit 263b09fd51
2 changed files with 1 additions and 2 deletions
-1
View File
@@ -137,7 +137,6 @@ class OnTask extends Callback
if (empty($serialize = swoole_unserialize($data))) { if (empty($serialize = swoole_unserialize($data))) {
return null; return null;
} }
$serialize = array_shift($serialize);
if (!($serialize instanceof ITask)) { if (!($serialize instanceof ITask)) {
return null; return null;
} }
+1 -1
View File
@@ -52,7 +52,7 @@ class Async extends Component
$randWorkerId = random_int(0, $server->setting['task_worker_num'] - 1); $randWorkerId = random_int(0, $server->setting['task_worker_num'] - 1);
$server->task(swoole_serialize([$class, 'onHandler']), $randWorkerId); $server->task(serialize($class), $randWorkerId);
} }
} }