Skip to content
This repository has been archived by the owner on Sep 10, 2024. It is now read-only.

Commit

Permalink
fix could not working task when enabling task_enable_coroutine on swo…
Browse files Browse the repository at this point in the history
…ole_http.php
  • Loading branch information
m3m0r7 committed Apr 21, 2021
1 parent f94b69f commit c89542d
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/Server/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -260,11 +260,19 @@ protected function resetOnRequest()
*
* @param mixed $server
* @param string|\Swoole\Server\Task $taskId or $task
* @param string $srcWorkerId
* @param mixed $data
* @param string|null $srcWorkerId
* @param mixed|null $data
*/
public function onTask($server, $taskId, $srcWorkerId, $data)
public function onTask($server, $task, $srcWorkerId = null, $data = null)
{
if ($task instanceof Task) {
$data = $task->data;
$srcWorkerId = $task->worker_id;
$taskId = $task->id;
} else {
$taskId = $task;
}

$this->container->make('events')->dispatch('swoole.task', func_get_args());

try {
Expand Down

0 comments on commit c89542d

Please sign in to comment.