dev-master
9999999-dev
MIT
The Requires
by Valerii Tropin
redis emitter socket.io
1.0.0
1.0.0.0
MIT
The Requires
by Valerii Tropin
redis emitter socket.io
Wallogit.com
2017 © Pedro Peláez
Async implementation of socket.io emitter written in php. Built on top of ReactPHP components., (*1)
composer require valeriitropin/socketio-emitter
use React\EventLoop\Factory as ReactFactory;
use ValeriiTropin\Socketio\Emitter;
$loop = ReactFactory::create();
$emitter = new Emitter($loop);
$promise = $emitter->to($room)->emit($event, $data)
->then(function () {})
->otherwise(function ($error) {});
key: pub/sub events prefix (socket.io)namespace: socket.io namespace (/)uri: Redis connection string, see docs (localhost)client: pub clientAdds room and returns current Emitter instance, (*2)
$emitter->to($room);
Creates new Emitter instance with given namespace., (*3)
$emitter->of($namespace);
Emits event with data to set rooms., (*4)
$emitter->emit($event, $data)
->then(function () {})
->otherwise(function ($error) {});
Returns loop instance., (*5)
MIT
redis emitter socket.io
MIT
redis emitter socket.io