Class: Sidekiq::Throttled::Config
- Inherits:
-
Object
- Object
- Sidekiq::Throttled::Config
- Defined in:
- lib/sidekiq/throttled/config.rb
Overview
Configuration object.
Instance Attribute Summary collapse
-
#cooldown_period ⇒ Float?
Period in seconds to exclude queue from polling in case it returned #cooldown_threshold amount of throttled jobs in a row.
-
#cooldown_threshold ⇒ Integer
Amount of throttled jobs returned from the queue subsequently after which queue will be excluded from polling for the durations of #cooldown_period.
Instance Method Summary collapse
-
#initialize ⇒ Config
constructor
A new instance of Config.
Constructor Details
#initialize ⇒ Config
Returns a new instance of Config.
22 23 24 25 |
# File 'lib/sidekiq/throttled/config.rb', line 22 def initialize @cooldown_period = 2.0 @cooldown_threshold = 1 end |
Instance Attribute Details
#cooldown_period ⇒ Float?
Period in seconds to exclude queue from polling in case it returned #cooldown_threshold amount of throttled jobs in a row.
Set this to ‘nil` to disable cooldown completely.
13 14 15 |
# File 'lib/sidekiq/throttled/config.rb', line 13 def cooldown_period @cooldown_period end |
#cooldown_threshold ⇒ Integer
Amount of throttled jobs returned from the queue subsequently after which queue will be excluded from polling for the durations of #cooldown_period.
20 21 22 |
# File 'lib/sidekiq/throttled/config.rb', line 20 def cooldown_threshold @cooldown_threshold end |