I currently have a Rails 3.0 project with Ruby 1.9.2 and Resque.
My application has several working classes and several queues that are dynamically created (at runtime). In addition, there are several workers who can work in any queues, because there are no existing queues during startup, and they cannot be predicted:
$ COUNT=3 QUEUE=* rake resque:workers
Queues created based on the project identifier:
@queue = "project_#{project.id}".to_sym
For this queue, their tasks must be processed in order and one at a time. My problem is that having several employees, several tasks are processed in parallel.
Is there a way to set the maximum number of workers in a queue (up to 1)? Is there a way to block the queue during job processing?
Thanks!
Henrique zambon
source share