Class: Undertow::Configuration
- Inherits:
-
Object
- Object
- Undertow::Configuration
- Defined in:
- lib/undertow/configuration.rb
Instance Attribute Summary collapse
-
#drain_lock_key ⇒ Object
Redis key used for the distributed drain lock.
-
#max_batch ⇒ Object
Maximum number of IDs to pop from the buffer per drain per model.
-
#queue_name ⇒ Object
ActiveJob queue to use for DrainJob.
-
#redis ⇒ Object
A Redis client or connection pool.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #redis! ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
24 25 26 27 28 |
# File 'lib/undertow/configuration.rb', line 24 def initialize @max_batch = 1_000 @queue_name = :undertow @drain_lock_key = 'undertow:drain:lock' end |
Instance Attribute Details
#drain_lock_key ⇒ Object
Redis key used for the distributed drain lock. The scheduler acquires this lock (SET NX) before enqueueing DrainJob; the job releases it immediately on start so new work arriving mid-drain gets its own job on the next tick. Set to nil to disable lock management entirely.
22 23 24 |
# File 'lib/undertow/configuration.rb', line 22 def drain_lock_key @drain_lock_key end |
#max_batch ⇒ Object
Maximum number of IDs to pop from the buffer per drain per model.
13 14 15 |
# File 'lib/undertow/configuration.rb', line 13 def max_batch @max_batch end |
#queue_name ⇒ Object
ActiveJob queue to use for DrainJob.
16 17 18 |
# File 'lib/undertow/configuration.rb', line 16 def queue_name @queue_name end |
Instance Method Details
#redis! ⇒ Object
30 31 32 |
# File 'lib/undertow/configuration.rb', line 30 def redis! redis or raise 'Undertow.configuration.redis is not set' end |