Skip to content

Instantly share code, notes, and snippets.

@gnufied
Forked from wallace/gist:134601
Created June 23, 2009 16:38
Show Gist options
  • Save gnufied/134664 to your computer and use it in GitHub Desktop.
Save gnufied/134664 to your computer and use it in GitHub Desktop.
class QueueWorker < BackgrounDRb::MetaWorker
set_worker_name :queue_worker
QUEUE_WORKER_LIMIT = 2
def create(args = nil)
start_correct_number_of_workers
end
def start_correct_number_of_workers
1.upto(QUEUE_WORKER_LIMIT) do |worker_key|
MiddleMan.new_worker(:worker => :queue_worker, :worker_key => "queue_#{worker_key}")
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment