Skip to content

Commit

Permalink
Moved DSNs around
Browse files Browse the repository at this point in the history
  • Loading branch information
davedevelopment committed Dec 2, 2011
1 parent 0ebb240 commit 99a8c7c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions app.php
Expand Up @@ -40,11 +40,12 @@
}
});

$app['dispatcher.queue.dsn'] = 'tcp://localhost:5567';
$app['dispatcher.queue.pub.dsn'] = 'tcp://localhost:5567';
$app['dispatcher.queue.sub.dsn'] = 'tcp://localhost:5566';
$app['dispatcher.queue.pub'] = $app->share(function($c) {
$ctx = new ZMQContext();
$send = $ctx->getSocket(ZMQ::SOCKET_PUSH);
$send->connect($c['dispatcher.queue.dsn']);
$send->connect($c['dispatcher.queue.pub.dsn']);
return $send;
});

Expand Down Expand Up @@ -141,7 +142,7 @@
$app['dispatcher']->dispatch('blog.comments.new', $event);

return new Response(
json_encode($comment),
json_encode($comment) . "\n",
201,
array(
'Content-type' => 'application/json',
Expand Down
2 changes: 1 addition & 1 deletion refire.php
Expand Up @@ -16,7 +16,7 @@
$ctx = new ZMQContext();
$sub = $ctx->getSocket(ZMQ::SOCKET_SUB);
$sub->setSockOpt(ZMQ::SOCKOPT_SUBSCRIBE, '');
$sub->connect('tcp://localhost:5566');
$sub->connect($app['dispatcher.queue.sub.dsn']);
$poll = new ZMQPoll();
$poll->add($sub, ZMQ::POLL_IN);
$read = $wri = array();
Expand Down

0 comments on commit 99a8c7c

Please sign in to comment.