jablonka.czprosek.czf

freenet-router

Subversion Repositories:
[/] [trunk/] [freenet-router/] [var/] [www/] [freenet-router/] [Framework/] [Libraries/] [MessageBus/] [ZMQPuller.php] - Blame information for rev 2

 

Line No. Rev Author Line
12simandl<?php
2 
3namespace Phem\Libraries\MessageBus;
4 
5use React\EventLoop\LoopInterface;
6use React\ZMQ\Context;
7 
8/**
9 * @author Jakub PetrŞílka <petrzilka@czweb.net>
10 */
11class ZMQPuller extends WebsocketPuller
12{
13 
14 protected $server;
15 
16 public function __construct(LoopInterface $loop, MessageBus $msgBus)
17 {
18 $context = new Context($loop);
19 $this->server = $context->getSocket(\ZMQ::SOCKET_PULL);
20 $this->server->on('message', array($msgBus, 'onNotify'));
21 }
22 
23 public function listen($ip, $port)
24 {
25 $this->server->bind('tcp://'.$ip.':'.$port);
26 }
27 
28}

Powered by WebSVN 2.2.1