A PHP implementation of socket.io-emitter (0.1.0).
composer require exls/socket.io-emitter
use Predis;
use Exls\SocketIO;
...
$client = new Predis\Client();
(new Emitter($client))
->of('namespace')->emit('event', 'payload message');
Possible flags
- json
- volatile
- broadcast
use Predis;
use Exls\SocketIO;
...
$client = new Predis\Client();
(new Emitter($client))
->broadcast->emit('broadcast-event', 'payload message');
use Predis;
use Exls\SocketIO;
...
$client = new Predis\Client();
(new Emitter($client))
->emit('broadcast-event', ['param1' => 'value1', 'param2' => 'value2', ]);