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
  settings[:can_run_every]
end

.disabledObject



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

def self.disabled
  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)
  [self.to_s, identifier(*args)].compact.join(":")
end

.settingsObject



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

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

.throttle(args = {}) ⇒ Object



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

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