Module: Resque

Defined in:
lib/resque/plugins/concurrent_restriction/concurrent_restriction_job.rb,
lib/resque/plugins/concurrent_restriction/version.rb,
lib/resque/plugins/concurrent_restriction/resque_worker_extension.rb

Overview

To configure resque concurrent restriction, add something like the following to an initializer (defaults shown):

Resque::Plugins::ConcurrentRestriction.configure do |config|
  # The lock timeout for the restriction queue lock
  config.lock_timeout = 60
  # How many times to try to get a lock before giving up
  # Worker stays busy for: 2^tries * rand(100) * 0.001 (~30s-3000s)
  config.lock_tries = 10
  # Try this many times to reserve a job from a queue. Also, the maximum
  # number of jobs to move to the restricted queue during this process
  # before giving up
  config.reserve_queued_job_attempts = 10
  # Try to pick jobs off of the restricted queue before normal queues
  config.restricted_before_queued = true
end

Defined Under Namespace

Modules: Plugins