Skip to content
This repository was archived by the owner on Mar 24, 2025. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix could not working task when enabling task_enable_coroutine on swo…
…ole_http.php
  • Loading branch information
m3m0r7 committed Apr 21, 2021
commit c89542d29a5ca138b3fab916b41d6a6adf4f4df6
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