Class: Sidekiq::Throttled::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/sidekiq/throttled/config.rb

Overview

Configuration object.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfig

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_periodFloat?

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.

Returns:

  • (Float, nil)


13
14
15
# File 'lib/sidekiq/throttled/config.rb', line 13

def cooldown_period
  @cooldown_period
end

#cooldown_thresholdInteger

Amount of throttled jobs returned from the queue subsequently after which queue will be excluded from polling for the durations of #cooldown_period.

Returns:

  • (Integer)


20
21
22
# File 'lib/sidekiq/throttled/config.rb', line 20

def cooldown_threshold
  @cooldown_threshold
end