[rabbitmq-discuss] How to spawn multiple worker processes (in Ruby) to respond to messages
stastny at 101ideas.cz
Mon Mar 21 09:54:50 GMT 2011
Ahmed, I think the best is to use Kernel#fork: just let your script load all
the dependencies and do all the setup except the actual connection to AMQP,
then fork how many times you need and then in the fork just run AMQP.start.
# some setup
pid = fork do
And probably Process.detach(pid)
On 21 March 2011 03:15, S Ahmed <sahmed1020 at gmail.com> wrote:
> I want to have multiple worker processes to respond to messages in a
> particular queue.
> Some tasks may take longer to process than others.
> In Ruby, what options do I have to spawn 3-4 processes to run at the same
> rabbitmq-discuss mailing list
> rabbitmq-discuss at lists.rabbitmq.com
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the rabbitmq-discuss