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-11-18 08:43:52 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');