【workbunny/webman-rabbitmq】eventLoop协程设置swoole报错
问题描述
设置eventLoop为swoole时,启动出现报错

报错信息
ArgumentCountError: Swoole\Coroutine::resume() expects exactly 1 argument, 2 given in /www/wwwroot/project/game/vendor/workerman/coroutine/src/Coroutine/Swoole.php:88
#0 /www/wwwroot/project/game/vendor/workerman/coroutine/src/Coroutine/Swoole.php(88): Swoole\Coroutine::resume()
#1 /www/wwwroot/project/game/vendor/workbunny/webman-rabbitmq/src/Connection/Connection.php(192): Workerman\Coroutine\Coroutine\Swoole->resume()
#2 /www/wwwroot/project/game/vendor/workbunny/webman-rabbitmq/src/Connection/Traits/InitMethods.php(252): Workbunny\WebmanRabbitMQ\Connection\Connection->wakeup()
#3 /www/wwwroot/project/game/vendor/workerman/workerman/src/Connection/TcpConnection.php(816): Workbunny\WebmanRabbitMQ\Connection\Connection->{closure:Workbunny\WebmanRabbitMQ\Connection\Traits\InitMethods::connection():243}()
#4 /www/wwwroot/project/game/vendor/workerman/workerman/src/Events/Swoole.php(288): Workerman\Connection\TcpConnection->baseRead()
#5 [internal function]: Workerman\Events\Swoole->{closure:Workerman\Events\Swoole::safeCall():286}()
#6 {main}
ErrorException: Attempt to read property "mechanisms" on false in /www/wwwroot/project/game/vendor/workbunny/webman-rabbitmq/src/Connection/Traits/InitMethods.php:206
Stack trace:
#0 /www/wwwroot/project/game/vendor/workbunny/webman-rabbitmq/src/Connection/Traits/InitMethods.php(206): {closure:/www/wwwroot/project/game/support/bootstrap.php:31}()
#1 /www/wwwroot/project/game/vendor/workerman/workerman/src/Connection/AsyncTcpConnection.php(497): Workbunny\WebmanRabbitMQ\Connection\Connection->{closure:Workbunny\WebmanRabbitMQ\Connection\Traits\InitMethods::connection():196}()
#2 /www/wwwroot/project/game/vendor/workerman/workerman/src/Events/Swoole.php(288): Workerman\Connection\AsyncTcpConnection->checkConnection()
#3 [internal function]: Workerman\Events\Swoole->{closure:Workerman\Events\Swoole::safeCall():286}()
#4 {main}
[FATAL ERROR]: all coroutines (count: 1) are asleep - deadlock!
[Coroutine-1]
#0 /www/wwwroot/project/game/vendor/workerman/workerman/src/Timer.php(195): Swoole\Coroutine\System::sleep()
#1 /www/wwwroot/project/game/vendor/workbunny/webman-rabbitmq/src/Builders/QueueBuilder.php(87): Workerman\Timer::sleep()
#2 /www/wwwroot/project/game/vendor/workerman/webman-framework/src/support/helpers.php(512): Workbunny\WebmanRabbitMQ\Builders\QueueBuilder->onWorkerStart()
#3 /www/wwwroot/project/game/vendor/workerman/webman-framework/src/support/helpers.php(558): worker_bind()
#4 /www/wwwroot/project/game/vendor/workerman/workerman/src/Worker.php(2641): {closure:worker_start():549}()
#5 [internal function]: Workerman\Worker->{closure:Workerman\Worker::run():2639}()
截图报错信息里报错文件相关代码


操作系统及workerman/webman等框架组件具体版本
PHP: 8.4
系统: linux
framework: workerman/webman-framework: "^2.1",
插件: "workbunny/webman-rabbitmq": "^3.0",
1个回答
swoole的 Coroutine::resume只接受一个cid参数,resume将...$args也放进后报了参数数量错误