一个项目中能在process中配置多个gateway、worker、register吗? 想的是有多个业务进程
大意了,端口还没改到
怎么配置的。方便贴一下代码吗,我也有这个需求,webman里面配置两个gateway
讲道理应该可以
就是多复制一下3个配置
<?php use Webman\GatewayWorker\Gateway; use Webman\GatewayWorker\BusinessWorker; use Webman\GatewayWorker\Register; return [ 'gateway' => [ 'handler' => Gateway::class, 'listen' => 'websocket://0.0.0.0:7272', 'count' => cpu_count(), 'reloadable' => false, 'constructor' => ['config' => [ 'lanIp' => '127.0.0.1', 'startPort' => 2300, 'pingInterval' => 25, 'pingNotResponseLimit' => 1, 'pingData' => '', 'registerAddress' => '127.0.0.1:1236', 'onConnect' => function(){}, ]] ], 'worker' => [ 'handler' => BusinessWorker::class, 'count' => cpu_count()*2, 'constructor' => ['config' => [ 'eventHandler' => plugin\webman\gateway\Events::class, 'name' => 'ChatBusinessWorker', 'registerAddress' => '127.0.0.1:1236', ]] ], 'register' => [ 'handler' => Register::class, 'listen' => 'text://127.0.0.1:1236', 'count' => 1, // Must be 1 'constructor' => [] ], 'gateway_demo' => [ 'handler' => Gateway::class, 'listen' => 'websocket://0.0.0.0:7373', 'count' => cpu_count(), 'reloadable' => false, 'constructor' => ['config' => [ 'lanIp' => '127.0.0.1', 'startPort' => 2400, 'pingInterval' => 25, 'pingNotResponseLimit' => 1, 'pingData' => '', 'registerAddress' => '127.0.0.1:1237', 'onConnect' => function(){}, ]] ], 'worker_demo' => [ 'handler' => BusinessWorker::class, 'count' => cpu_count()*2, 'constructor' => ['config' => [ 'eventHandler' => plugin\webman\gateway\Demo::class, 'name' => 'worker_demo', 'registerAddress' => '127.0.0.1:1237', ]] ], 'register_demo' => [ 'handler' => Register::class, 'listen' => 'text://127.0.0.1:1237', 'count' => 1, // Must be 1 'constructor' => [] ], ];
感谢
两个gateway调用Gateway::sendToUid()有影响吗。我绑定了。但是发送消息收不到
怎么配置的。方便贴一下代码吗,我也有这个需求,webman里面配置两个gateway
讲道理应该可以
就是多复制一下3个配置
感谢
两个gateway调用Gateway::sendToUid()有影响吗。我绑定了。但是发送消息收不到