1

I need to dispatch a job from a swoole coroutine environment. if I directly use the default redis connection. an error will be thrown

Uncaught Swoole\Error: Socket#17 has already been bound to another coroutine#81, reading of the same socket in coroutine#80 at the same time is not allowed

I think this should be caused by the redis connection.

so I want the dispatcher uses a connection pulled from a connection pool to dispatch the job.

How could I apply my redis connection object to the dispatcher?

rain hon
  • 11
  • 2
  • I solve this problem by replacing the laravel job with swoole task. And disable coroutine for the task worker. Then the task can use laravel code as usual now. – rain hon Oct 06 '22 at 08:36

0 Answers0