启动GatewayWorker提示“Waring: Events::onMessage is not callable”

584次阅读
没有评论
---------------------------------------------- WORKERMAN -----------------------------------------------
Workerman version:4.1.13 PHP version:7.4.8
----------------------------------------------- WORKERS ------------------------------------------------
worker listen processes status
ChatBusinessWorker none 1 [ok]
Waring: Events::onMessage is not callable
Register text://0.0.0.0:1236 1 [ok]
ChatGateway websocket://0.0.0.0:7272 1 [ok]

问题描述:

明明定义了“Events”类,在升级了 GatewayWorker 之后就提示“Waring: Events::onMessage is not callable”

解决方法:

在启动 bussinessWorker 进程文件的文件中,引入“Events”类

require_once __DIR__ . '/Events.php';

...

$worker->eventHandler = 'Events'; // 该属性的默认值为“Events”,故此行可以忽略 

启动 GatewayWorker 提示“Waring: Events::onMessage is not callable”

正文完
有偿技术支持加微信
post-qrcode
 
评论(没有评论)
验证码