-
Notifications
You must be signed in to change notification settings - Fork 13
Open
Description
如果是直接配置了Swoole:
<?php
use Workerman\Events\Swoole;
return [
'Consumer' => [
'handler' => Webman\RedisQueue\Process\Consumer::class,
'count' => 8, // 可以设置多进程同时消费
'eventLoop' => Swoole::class,
'constructor' => [
// 消费者类目录
'consumer_dir' => base_path('plugin/shortplay/queue')
]
]
];那么在启动时报错:
TypeError: swoole_socket_set_option(): Argument #1 ($socket) must be of type Swoole\Coroutine\Socket, Socket given in @swoole-src/library/ext/sockets.php:157
Stack trace:
#0 [internal function]: swoole_socket_set_option()
#1 /home/www/wwwroot/xx/vendor/workerman/workerman/src/Connection/AsyncTcpConnection.php(388): socket_set_option()
#2 /home/www/wwwroot/xx/vendor/workerman/workerman/src/Events/Swoole.php(288): Workerman\Connection\AsyncTcpConnection->checkConnection()
#3 [internal function]: Workerman\Events\Swoole->Workerman\Events\{closure}()
#4 {main}
如果未配置Swoole:
<?php
return [
'Consumer' => [
'handler' => Webman\RedisQueue\Process\Consumer::class,
'count' => 8, // 可以设置多进程同时消费
'constructor' => [
// 消费者类目录
'consumer_dir' => base_path('plugin/shortplay/queue')
]
]
];那么在投递时报错:
TypeError: swoole_socket_set_option(): Argument #1 ($socket) must be of type Swoole\Coroutine\Socket, Socket given in @swoole-src/library/ext/sockets.php:157
Stack trace:
#0 [internal function]: swoole_socket_set_option()
#1 /home/www/wwwroot/xx/vendor/workerman/workerman/src/Connection/AsyncTcpConnection.php(388): socket_set_option()
#2 /home/www/wwwroot/xx/vendor/workerman/workerman/src/Events/Swoole.php(288): Workerman\Connection\AsyncTcpConnection->checkConnection()
#3 [internal function]: Workerman\Events\Swoole->Workerman\Events\{closure}()
#4 {main}
webman服务使用Swoole才报错
| event-loop | proto | user | worker | listen | count | state |
|---|---|---|---|---|---|---|
| swoole | tcp | root | webman | http://0.0.0.0:36300 | 1 | [OK] |
Metadata
Metadata
Assignees
Labels
No labels