views:

297

answers:

3

I want to use Delayed::Job (or perhaps a more appropriate job queue to my problem) to dispatch jobs to multiple background daemons.

I have several background daemons that carry out different responsibilities. Each one is interested in different jobs in the queue from the Rails app. Is this possible using Delayed::Job, or perhaps there is a different job queue that better fits this task?

+1  A: 

DJ workers just grab the first job from the queue (there's only one) and do it. Each worker is the same as any other. You can run multiple workers, but they will all work from the same queue.

x1a4
+2  A: 

If you like the Delayed Job, it'd be simple enough to create multiple tables, one per queue

The worker gets it's table name from

class Job < ActiveRecord::Base
    MAX_ATTEMPTS = 25
    MAX_RUN_TIME = 4.hours
    set_table_name :delayed_jobs

So you could edit that and create one migration per table. And then when you start your jobs, you'll start one worker per queue.

Source: http://github.com/tobi/delayed_job

Jesse Wolgamott
A: 

Resque is a job queue library that supports multiple queues.

johngrimes