Download the PHP package valeriitropin/socketio-redis-adapter without Composer
On this page you can find all versions of the php package valeriitropin/socketio-redis-adapter. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package socketio-redis-adapter
PHP socket.io redis adapter
Partial port of socket.io redis adapter, async, allows to get clients/rooms and to manage them. The main goal of this project is possibility to communicate between php and socket.io applications. Built on top of ReactPHP components.
Installation
How to use
API
RedisAdapter
__construct(React\EventLoop\LoopInterface $loop, $options = [])
$options:
prefix
: pub/sub events prefix (socket.io
)requestsTimeout
: timeout in milliseconds, float (5
)namespace
: socket.io namespace (/
)pubClient
: pub clientsubClient
: pub clientcustomHook
: callableuri
: Redis connection string, see docs (localhost
)
clients($rooms = []): React\Promise\Promise
Returns the list of client IDs connected to rooms
across all nodes.
clientRooms($id): React\Promise\Promise
Returns the list of rooms the client with the given ID has joined (even on another node).
allRooms(): React\Promise\Promise
Returns the list of all rooms from all nodes.
remoteJoin($id, $room): React\Promise\Promise
remoteLeave($id, $room): React\Promise\Promise
remoteDisconnect($id, $close): React\Promise\Promise
customRequest($data): React\Promise\Promise
Sends a request to every nodes, that will respond through the customHook
method.
getLoop(): React\EventLoop\LoopInterface
Returns loop instance.
getPub(): Clue\React\Redis\StreamingClient
Returns pub client.
getSub(): Clue\React\Redis\StreamingClient
Returns sub client.
unsubscribeFromRequestChannel(): React\Promise\Promise
Unsubscribes the adapter instance from request channel.