Skip to content

exls/socket.io-emitter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

exls/socket.io-emitter

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', ]);

About

PHP implementation of socket.io-emitter

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages