jablonka.czprosek.czf

freenet-router

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

Compare with Previous - Blame - Download


<?php

namespace Phem\Libraries\MessageBus;

use Ratchet\WebSocket\Version\RFC6455\Message;

/**
 * @author Jakub PetrŞílka <petrzilka@czweb.net>
 */
class ZMQPusher extends Pusher
{
    public function push($message)
    {
        $context = new \ZMQContext();
        $socket = $context->getSocket(\ZMQ::SOCKET_PUSH, 'ZMQ Pusher');
        $socket->connect("tcp://" . WEBSOCKET_PULLER_BIND_ADDR 
                . ":" . WEBSOCKET_PULLER_PORT);

        $socket->send(json_encode($message));        
    }
}

Powered by WebSVN 2.2.1