exls / socket.io-emitter
PHP socket.io emitter
Installs: 35 276
Dependents: 1
Suggesters: 0
Security: 0
Stars: 3
Watchers: 2
Forks: 9
Open Issues: 0
Requires
- php: >=5.6.4
- predis/predis: ^1.0
- rybakit/msgpack: ^0.1.0
This package is not auto-updated.
Last update: 2025-02-21 21:35:19 UTC
README
A PHP implementation of socket.io-emitter (0.1.0).
Installation
composer require exls/socket.io-emitter
Usage
Emit payload message
use Predis; use Exls\SocketIO; ... $client = new Predis\Client(); (new Emitter($client)) ->of('namespace')->emit('event', 'payload message');
Flags
Possible flags
- json
- volatile
- broadcast
To use flags, just call it like in example bellow
use Predis; use Exls\SocketIO; ... $client = new Predis\Client(); (new Emitter($client)) ->broadcast->emit('broadcast-event', 'payload message');
Emit an object
use Predis; use Exls\SocketIO; ... $client = new Predis\Client(); (new Emitter($client)) ->emit('broadcast-event', ['param1' => 'value1', 'param2' => 'value2', ]);