freenet-router |
Subversion Repositories: |
Compare with Previous - Blame - Download
<?php
namespace Phem\Libraries\MessageBus;
use React\EventLoop\LoopInterface;
use React\ZMQ\Context;
/**
* @author Jakub PetrĹžĂlka <petrzilka@czweb.net>
*/
class ZMQPuller extends WebsocketPuller
{
protected $server;
public function __construct(LoopInterface $loop, MessageBus $msgBus)
{
$context = new Context($loop);
$this->server = $context->getSocket(\ZMQ::SOCKET_PULL);
$this->server->on('message', array($msgBus, 'onNotify'));
}
public function listen($ip, $port)
{
$this->server->bind('tcp://'.$ip.':'.$port);
}
}