Class: RubyReactor::Configuration
- Inherits:
-
Object
- Object
- RubyReactor::Configuration
- Includes:
- Singleton
- Defined in:
- lib/ruby_reactor/configuration.rb
Overview
Configuration class for RubyReactor settings
Instance Attribute Summary collapse
- #async_router ⇒ Object
-
#lock_snooze_base_delay ⇒ Object
Base seconds the Sidekiq worker waits before re-checking a contended lock.
-
#lock_snooze_jitter ⇒ Object
Extra random seconds added to the base delay to avoid thundering herd.
-
#lock_snooze_max_attempts ⇒ Object
How many times a single job can snooze on lock contention before it is marked as failed.
- #logger ⇒ Object
- #middlewares ⇒ Object
- #sidekiq_queue ⇒ Object
- #sidekiq_retry_count ⇒ Object
Instance Method Summary collapse
Instance Attribute Details
#async_router ⇒ Object
42 43 44 |
# File 'lib/ruby_reactor/configuration.rb', line 42 def async_router @async_router ||= RubyReactor::SidekiqAdapter end |
#lock_snooze_base_delay ⇒ Object
Base seconds the Sidekiq worker waits before re-checking a contended lock.
23 24 25 |
# File 'lib/ruby_reactor/configuration.rb', line 23 def lock_snooze_base_delay @lock_snooze_base_delay ||= 5 end |
#lock_snooze_jitter ⇒ Object
Extra random seconds added to the base delay to avoid thundering herd.
28 29 30 |
# File 'lib/ruby_reactor/configuration.rb', line 28 def lock_snooze_jitter @lock_snooze_jitter ||= 5 end |
#lock_snooze_max_attempts ⇒ Object
How many times a single job can snooze on lock contention before it is marked as failed. Set to :infinity to never escalate.
34 35 36 |
# File 'lib/ruby_reactor/configuration.rb', line 34 def lock_snooze_max_attempts @lock_snooze_max_attempts ||= 20 end |
#logger ⇒ Object
38 39 40 |
# File 'lib/ruby_reactor/configuration.rb', line 38 def logger @logger ||= Logger.new($stderr) end |
#middlewares ⇒ Object
59 60 61 |
# File 'lib/ruby_reactor/configuration.rb', line 59 def middlewares @middlewares ||= [] end |
#sidekiq_queue ⇒ Object
14 15 16 |
# File 'lib/ruby_reactor/configuration.rb', line 14 def sidekiq_queue @sidekiq_queue ||= :default end |
#sidekiq_retry_count ⇒ Object
18 19 20 |
# File 'lib/ruby_reactor/configuration.rb', line 18 def sidekiq_retry_count @sidekiq_retry_count ||= 3 end |
Instance Method Details
#storage ⇒ Object
46 47 48 |
# File 'lib/ruby_reactor/configuration.rb', line 46 def storage @storage ||= RubyReactor::Storage::Configuration.new end |
#storage_adapter ⇒ Object
50 51 52 53 54 55 56 57 |
# File 'lib/ruby_reactor/configuration.rb', line 50 def storage_adapter @storage_adapter ||= case storage.adapter when :redis RubyReactor::Storage::RedisAdapter.new(url: storage.redis_url, **storage.) else raise "Unknown storage adapter: #{storage.adapter}" end end |