albert-shtein / socket.io-amqp-emitter
socket.io-emitter 的 PHP amqp 实现
dev-master
2019-02-01 14:33 UTC
Requires
- php: >=5.6
- php-amqplib/php-amqplib: ^2.8
Requires (Dev)
- phpunit/phpunit: >=4.8 < 6.0
This package is not auto-updated.
Last update: 2024-09-23 08:04:55 UTC
README
A PHP amqp implementation of socket.io-emitter.
PHP 库是为了与 socket.io-amqp 配对使用而设计的
用法
初始化
$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?']);
广播和其他标志
可能的标志
- broadcast
$emitter = new Emitter($connection); $emitter->broadcast->emit('event', 'something else');