Class: Resque::ThrottledJob

Inherits:
Object
  • Object
show all
Defined in:
lib/resque/throttled_job.rb

Constant Summary collapse

THROTTLE_DEFAULTS =
{
    :can_run_every => 1800,
    :disabled      => false,
}

Class Method Summary collapse

Class Method Details

.can_run_everyObject



26
27
28
# File 'lib/resque/throttled_job.rb', line 26

def self.can_run_every
  throttle_settings[:can_run_every]
end

.disabledObject



30
31
32
# File 'lib/resque/throttled_job.rb', line 30

def self.disabled
  throttle_settings[:disabled]
end

.identifier(*args) ⇒ Object



19
20
# File 'lib/resque/throttled_job.rb', line 19

def self.identifier(*args)
end

.key(*args) ⇒ Object



22
23
24
# File 'lib/resque/throttled_job.rb', line 22

def self.key(*args)
  ['resque-throttle', self.to_s, identifier(*args)].compact.join(":")
end

.throttle(args = {}) ⇒ Object



15
16
17
# File 'lib/resque/throttled_job.rb', line 15

def self.throttle(args = {})
  throttle_settings.merge!(args)
end

.throttle_settingsObject



11
12
13
# File 'lib/resque/throttled_job.rb', line 11

def self.throttle_settings
  @throttle_settings ||= THROTTLE_DEFAULTS.dup
end