Class: Undertow::Configuration
- Inherits:
-
Object
- Object
- Undertow::Configuration
- Defined in:
- lib/undertow/configuration.rb
Instance Attribute Summary collapse
-
#drain_lock_key ⇒ Object
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.
-
#store ⇒ Object
# In-memory (test / single-process dev) Undertow.configure do |c| c.store = Undertow::Store::MemoryStore.new end.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #store! ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
33 34 35 36 37 38 |
# File 'lib/undertow/configuration.rb', line 33 def initialize @store = Undertow::Store::MemoryStore.new @max_batch = 1_000 @queue_name = :undertow @drain_lock_key = 'undertow:drain:lock' end |
Instance Attribute Details
#drain_lock_key ⇒ Object
Key used for the distributed drain lock. The scheduler acquires this lock 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.
31 32 33 |
# File 'lib/undertow/configuration.rb', line 31 def drain_lock_key @drain_lock_key end |
#max_batch ⇒ Object
Maximum number of IDs to pop from the buffer per drain per model.
22 23 24 |
# File 'lib/undertow/configuration.rb', line 22 def max_batch @max_batch end |
#queue_name ⇒ Object
ActiveJob queue to use for DrainJob.
25 26 27 |
# File 'lib/undertow/configuration.rb', line 25 def queue_name @queue_name end |
Instance Method Details
#store! ⇒ Object
40 41 42 |
# File 'lib/undertow/configuration.rb', line 40 def store! store or raise 'Undertow.configuration.store is not set' end |