Class: Sidekiq::Ultimate::Configuration
- Inherits:
-
Object
- Object
- Sidekiq::Ultimate::Configuration
- Includes:
- Singleton
- Defined in:
- lib/sidekiq/ultimate/configuration.rb
Overview
Configuration options.
Constant Summary collapse
- DEFAULT_EMPTY_QUEUES_CACHE_REFRESH_INTERVAL_SEC =
30
- DEFAULT_THROTTLED_FETCH_TIMEOUT_SEC =
15
Instance Attribute Summary collapse
-
#empty_queues_cache_refresh_interval_sec ⇒ Numeric
It specifies how often the cache of empty queues should be refreshed.
-
#enable_resurrection_counter ⇒ Boolean
If ‘enable_resurrection_counter` setting is enabled, on each resurrection event, a counter is increased.
-
#on_resurrection {|queue_name, jobs_count| ... } ⇒ Proc
Callback to be called when job is resurrected.
- #throttled_fetch_timeout_sec ⇒ Object
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
44 45 46 47 48 |
# File 'lib/sidekiq/ultimate/configuration.rb', line 44 def initialize @empty_queues_cache_refresh_interval_sec = DEFAULT_EMPTY_QUEUES_CACHE_REFRESH_INTERVAL_SEC @throttled_fetch_timeout_sec = DEFAULT_THROTTLED_FETCH_TIMEOUT_SEC super end |
Instance Attribute Details
#empty_queues_cache_refresh_interval_sec ⇒ Numeric
It specifies how often the cache of empty queues should be refreshed. In a nutshell, it specifies the maximum possible delay between a job was pushed to previously empty queue and the moment when that new job is picked up. Note that every sidekiq process needs to maintain its own local cache of empty queues. Setting this interval to a low values will increase the number of redis calls and will increase the load on redis.
33 34 35 |
# File 'lib/sidekiq/ultimate/configuration.rb', line 33 def empty_queues_cache_refresh_interval_sec @empty_queues_cache_refresh_interval_sec end |
#enable_resurrection_counter ⇒ Boolean
If ‘enable_resurrection_counter` setting is enabled, on each resurrection event, a counter is increased. This is useful for telemetry purposes in order to understand how often jobs are resurrected Counter value is stored in redis by jid and has expiration time 24 hours.
25 26 27 |
# File 'lib/sidekiq/ultimate/configuration.rb', line 25 def enable_resurrection_counter @enable_resurrection_counter end |
#on_resurrection {|queue_name, jobs_count| ... } ⇒ Proc
Returns callback to be called when job is resurrected.
19 20 21 |
# File 'lib/sidekiq/ultimate/configuration.rb', line 19 def on_resurrection @on_resurrection end |
#throttled_fetch_timeout_sec ⇒ Object
58 59 60 61 62 63 64 |
# File 'lib/sidekiq/ultimate/configuration.rb', line 58 def throttled_fetch_timeout_sec if @throttled_fetch_timeout_sec.respond_to?(:call) @throttled_fetch_timeout_sec.call.to_f else @throttled_fetch_timeout_sec.to_f end end |