freenet-router |
Subversion Repositories: |
Line No. | Rev | Author | Line |
---|---|---|---|
1 | 2 | simandl | <?php |
2 | |
||
3 | namespace Phem\Libraries\MessageBus; |
||
4 | |
||
5 | use Ratchet\WebSocket\Version\RFC6455\Message; |
||
6 | |
||
7 | /** |
||
8 | * @author Jakub PetrĹžĂlka <petrzilka@czweb.net> |
||
9 | */ |
||
10 | class ZMQPusher extends Pusher |
||
11 | { |
||
12 | public function push($message) |
||
13 | { |
||
14 | $context = new \ZMQContext(); |
||
15 | $socket = $context->getSocket(\ZMQ::SOCKET_PUSH, 'ZMQ Pusher'); |
||
16 | $socket->connect("tcp://" . WEBSOCKET_PULLER_BIND_ADDR |
||
17 | . ":" . WEBSOCKET_PULLER_PORT); |
||
18 | |
||
19 | $socket->send(json_encode($message)); |
||
20 | } |
||
21 | } |