Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix could not working onTask when enabling task_enable_coroutine on swoole_http.php #483

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 join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants