windows環(huán)境下,用Timer 不執(zhí)行
$worker->onWorkerStart=function($cur_worker){
Timer::add(1,function() use ($last_count){
global $last_count;
$send_data=array(
'action'=>'tongji',
'content'=>"當前在線的人數(shù):{$last_count}"
);
$send_str=json_encode($send_data,true);
sendAll($send_str);
});
};