albert-shtein/socket.io-amqp-emitter

A PHP amqp implementation of socket.io-emitter

dev-master 2019-02-01 14:33 UTC

This package is not auto-updated.

Last update: 2024-04-08 05:49:48 UTC


README

A PHP amqp implementation of socket.io-emitter.

PHP Library is designed for using in pair with socket.io-amqp

Usage

Initialization

$connection = new AMQPStreamConnection('192.168.1.211', 5672, 'guest', 'guest');
$emitter = new Emitter($connection);
$emitter
    ->of('/v1')
    ->to('best')
    ->to('room')
    ->to('ever')
    ->emit('chat', ['everything' => 'is ok?']);

Broadcasting and other flags

Possible flags

  • broadcast
$emitter = new Emitter($connection);
$emitter->broadcast->emit('event', 'something else');