onWorkerStart global

public static function onWorkerStart($bk) { if ($bk->id == 0) { global $worker; $worker = new TestWorker(); } } global $worker; Log::info('onMessage:msg:', ); 用户进入房间 在onMessa...

onwnic 发表与 2018-10-20 1856 浏览 1 回答
workerman Timer

在 onWorkerStart 里面定义了 个全局的  global $_downTimer;   然后在 Timer 里面倒计时  代码如下 global $_downTimer; $_downTimer = 60; $_timer = Timer::add(1, function () use (&$_timer,&$_downTimer) { if($_downTimer == 0){...

onwnic 发表与 2018-10-19 3201 浏览 1 回答

onwnic

2040
积分
0
获赞数
0
粉丝数
2018-10-19 加入
🔝