up. 添加gateway event类

This commit is contained in:
u2nyakim 2025-08-29 17:57:00 +08:00
parent 73ae0cf33e
commit 87dc171497

View File

@ -49,7 +49,7 @@ class SysGateway extends Command
* 业务处理器 * 业务处理器
*/ */
$worker = new BusinessWorker(); $worker = new BusinessWorker();
$worker->name = 'ChatBusinessWorker'; $worker->name = 'AdminBusinessWorker';
$worker->count = 4; $worker->count = 4;
$worker->registerAddress = '127.0.0.1:1236'; $worker->registerAddress = '127.0.0.1:1236';
$worker->eventHandler = AdminGatewayEvents::class; $worker->eventHandler = AdminGatewayEvents::class;
@ -66,9 +66,9 @@ class SysGateway extends Command
private function startGateway(): \GatewayWorker\Gateway private function startGateway(): \GatewayWorker\Gateway
{ {
// gateway 进程 // gateway 进程
$gateway = new \GatewayWorker\Gateway("Websocket://0.0.0.0:7272"); $gateway = new \GatewayWorker\Gateway("Websocket://0.0.0.0:19981");
// 设置名称方便status时查看 // 设置名称方便status时查看
$gateway->name = 'ChatGateway'; $gateway->name = 'AdminGateway';
// 设置进程数,一般两个进程就足够 // 设置进程数,一般两个进程就足够
$gateway->count = 2; $gateway->count = 2;
// 分布式部署时请设置成内网ip非127.0.0.1 // 分布式部署时请设置成内网ip非127.0.0.1