Class: Resque::ThrottledJob
- Inherits:
-
Object
- Object
- Resque::ThrottledJob
- Defined in:
- lib/resque/throttled_job.rb
Constant Summary collapse
- THROTTLE_DEFAULTS =
{ :can_run_every => 1800, :disabled => false, }
Class Method Summary collapse
- .can_run_every ⇒ Object
- .disabled ⇒ Object
- .identifier(*args) ⇒ Object
- .key(*args) ⇒ Object
- .settings ⇒ Object
- .throttle(args = {}) ⇒ Object
Class Method Details
.can_run_every ⇒ Object
26 27 28 |
# File 'lib/resque/throttled_job.rb', line 26 def self.can_run_every settings[:can_run_every] end |
.disabled ⇒ Object
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 |
.settings ⇒ Object
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 |