nesquena / backburner

Simple and reliable beanstalkd job queue for ruby
http://nesquena.github.com/backburner
MIT License
429 stars 69 forks source link

Support for class specific queue limit, garbage, priority settings #72

Closed silentshade closed 10 years ago

silentshade commented 10 years ago

This pull request supports class specific settings for Backburner::Worker::ThreadsOnFork as follows:

class SuperJob
  include Backburner::Queue
  queue "super-job:5:1000:10"
end

the queue super-job will have 5 threads, 1000 garbage limit and 10 retries limit

class SuperJob
  include Backburner::Queue
  queue "super-job"
  queue_jobs_limit 2
  queue_garbage_limit  500
  queue_priority 6
end

the queue super-job will have 2 threads, 500 garbage limit and 6 retires limit.

Note: class specific settings (if not nil) override name specific settings.