One solution is to subscribe to the queue in your request handler:
app.get('/test', loadUser, function(req, res) {
queue.subscribe(function(msg) {
// Unsubcribe here. Maybe there is something like a once listener?
res.send(msg.data);
});
exchange.publish('task_queue', 'functional!', {
replyTo: 'incoming'
});
});
Don't know exactly if this is the thing you want to do? Cause this looks
more like a rpc request you want to make. Queues are more used for async
tasks where the result is returns later on and then I would prefer to use
socket.io for async response.
--
Job Board: http://jobs.nodejs.org/
Posting guidelines:
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en