diff --git a/src/Server/Manager.php b/src/Server/Manager.php index b93e66c9..4258a707 100644 --- a/src/Server/Manager.php +++ b/src/Server/Manager.php @@ -5,6 +5,7 @@ use Exception; use Throwable; use Swoole\Process; +use Swoole\Server\Task; use Illuminate\Support\Str; use SwooleTW\Http\Helpers\OS; use SwooleTW\Http\Server\Sandbox; @@ -256,13 +257,13 @@ protected function resetOnRequest() * Set onTask listener. * * @param mixed $server - * @param string|\Swoole\Server\Task $taskIdOrTask - * @param string $srcWorkerId Optional - * @param mixed $data Optional + * @param string|\Swoole\Server\Task $taskId or $task + * @param string $srcWorkerId + * @param mixed $data */ - public function onTask($server, ...$args) + public function onTask($server, $taskId, $srcWorkerId, $data) { - $this->container->make('events')->dispatch('swoole.task', [$server, $args]); + $this->container->make('events')->dispatch('swoole.task', func_get_args()); try { // push websocket message