Module: Resque

Defined in:
lib/resque_manager/overrides/resque/job.rb,
lib/resque_manager/overrides/resque/resque.rb,
lib/resque_manager/overrides/resque/worker.rb,
lib/resque_manager/overrides/resque_status/hash.rb,
lib/resque_manager/overrides/resque/failure/redis.rb,
lib/resque_manager/overrides/resque_status/status.rb,
lib/resque_manager/overrides/resque_status/chained_status.rb

Defined Under Namespace

Modules: Failure, Plugins Classes: Job, Worker

Class Method Summary collapse

Class Method Details

.throttle(queue, limit = 10000, sleep_for = 60) ⇒ Object


2
3
4
5
6
7
# File 'lib/resque_manager/overrides/resque/resque.rb', line 2

def self.throttle(queue, limit = 10000, sleep_for = 60)
  loop do
    break if Resque.size(queue.to_s) < limit
    sleep sleep_for
  end
end