Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
35 lines (29 sloc) 724 Bytes
<?php
/**
* @package
* @subpackage
*/
/**
* TITLE
*
* DESCRIPTION
*
* @author Dave Marshall <david.marshall@atstsolutions.co.uk>
*/
$app = include __DIR__.'/app.php';
$ctx = new ZMQContext();
$sub = $ctx->getSocket(ZMQ::SOCKET_SUB);
$sub->setSockOpt(ZMQ::SOCKOPT_SUBSCRIBE, '');
$sub->connect($app['dispatcher.queue.sub.dsn']);
$poll = new ZMQPoll();
$poll->add($sub, ZMQ::POLL_IN);
$read = $wri = array();
while(true) {
$ev = $poll->poll($read, $wri, 5000000);
if ($ev > 0) {
list($eventName, $event) = unserialize($sub->recv());
echo "Refiring $eventName\n";
$app['dispatcher']->oneTimeDisableFireHose();
$app['dispatcher']->dispatch($eventName, $event);
}
}