jablonka.czprosek.czf

freenet-router

Subversion Repositories:
[/] [trunk/] [freenet-router/] [var/] [www/] [freenet-router/] [Framework/] [Libraries/] [MessageBus/] [ZMQPuller.php] - Rev 2

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);
    }

}

Powered by WebSVN 2.2.1