Skip to content
This repository was archived by the owner on Mar 24, 2025. It is now read-only.

Conversation

@m3m0r7
Copy link
Contributor

@m3m0r7 m3m0r7 commented Apr 21, 2021

I enabled task_enable_coroutine on swoole_http.php, it does not work because it will pass 2 arguments (\Swoole\Server $server and Task $task only), not 4 arguments when enabling task_enable_coroutine.

Symfony\Component\Debug\Exception\FatalErrorException:

Uncaught ArgumentCountError: Too few arguments to function SwooleTW\Http\Server\Manager::onTask(), 2 passed and exactly 4 expected in /var/www/html/vendor/swooletw/laravel-swoole/src/Server/Manager.php:266

   > 266|     public function onTask($server, $taskId, $srcWorkerId, $data)
     267|     {
     268|         $this->container->make('events')->dispatch('swoole.task', func_get_args());
     269|
     270|         try {

This commit will fix it.

@Arkanius Arkanius merged commit ebc5859 into swooletw:master Apr 22, 2021
@m3m0r7 m3m0r7 deleted the fix-could-not-working-task-when-enabling-task_enable_coroutine branch April 23, 2021 12:16
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants