[rabbitmq-discuss] Amqp Gem and Unicorn
michael.s.klishin at gmail.com
Mon Dec 24 16:38:23 GMT 2012
2012/12/24 Milo Burr <burrmilo at gmail.com>
> 1. From my controllers, what is the best way to publish messages? That
> gist has the controllers calling "EventLoopHelper.run" and then publishing,
> but shouldn't the EM already be running in another thread?
There is no need to connect in every action, just assign an exchange
instance somewhere (a class variable or even a global) and use it.
> 2. I also want my unicorn rails app to subscribe to a queue that has the
> result of the long-running jobs that occur on another server. If I call
> subscribe in the reactor event loop, will that block the reactor from
> publishing messages submitted by the controllers?
No. But running consumers inside a Rails application does not make much
sense: Rails' low-level HTTP stack assumes synchronous
responses to HTTP clients. So you won't be able to easily propagate
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the rabbitmq-discuss