collectiveidea/delayed_job — pull request #606 by ndbroadbent (2013-11-30 01:06:25+00:00)
Title: Added --pools argument, so that multiple worker pools can be defined with different queues and numbers of workers.

We needed this so that we could restart multiple workers with different queues with one command via capistrano, and also so that our delayed job pids are consistent with our monit scripts. Running a separate restart command for each worker pool is very time-consuming, since the Rails environment needs to be loaded n times.

As an example, you can now add this to capistrano, to restart 3 "pools" of workers:

set :delayed_job_args, "--pools=*:2/mailers:1/important:2"

This will start `delayed_job.0` and `delayed_job.1` running any jobs, `delayed_job.2` running jobs from the **mailers** queue, and `delayed_job.3` and `delayed_job.4` running jobs from the **important** queue.

Specs included.