-
-
Save gnufied/134664 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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