Module: Resque

Extended by:
Resque
Included in:
Resque
Defined in:
lib/resque/resque.rb,
lib/resque/throttle.rb,
lib/resque/throttled_job.rb

Defined Under Namespace

Classes: SettingNotFound, ThrottledError, ThrottledJob

Instance Method Summary collapse

Instance Method Details

#enqueue_with_throttle(klass, *args) ⇒ Object Also known as: enqueue



9
10
11
12
13
14
# File 'lib/resque/resque.rb', line 9

def enqueue_with_throttle(klass, *args)
  if should_throttle?(klass, *args)
    raise ThrottledError.new("#{klass} with key #{klass.key(*args)} has exceeded it's throttle limit")
  end
  enqueue_without_throttle(klass, *args)
end