一個(gè)workerStart中怎么實(shí)現(xiàn)多個(gè)emit呢,如下寫法并沒有生效。
$io = new SocketIO(3120);
$io->on('workerStart', function(){
Timer::add(2, function() {
global $io;
// $componentLatest = shell_exec('cd ../index_web && php artisan componentLatest');
// $io->emit('getComponentLatest', $componentLatest);
$latest = shell_exec('cd ../index_web && php artisan latest');
$io->emit('getLatest', $latest);
});
});