提示无法获取onmessage函数。。求解
events.php加命名空间时,需要设置eventHandler。
use \Workerman\Worker; use \GatewayWorker\BusinessWorker;
$worker = new BusinessWorker(); $worker->name = 'ChatBusinessWorker'; $worker->count = 4; $worker->registerAddress = '127.0.0.1:1236';
/*
if(!defined('GLOBAL_START')) { Worker::runAll(); }
http://doc2.workerman.net/326110 参考手册
events.php加命名空间时,需要设置eventHandler。
use \Workerman\Worker;
use \GatewayWorker\BusinessWorker;
$worker = new BusinessWorker();
$worker->name = 'ChatBusinessWorker';
$worker->count = 4;
$worker->registerAddress = '127.0.0.1:1236';
/*
*/
$worker->eventHandler = '\my\namespace\MyEvent';
if(!defined('GLOBAL_START'))
{
Worker::runAll();
}
http://doc2.workerman.net/326110
参考手册