Class: Undertow::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/undertow/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

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_keyObject

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_batchObject

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_nameObject

ActiveJob queue to use for DrainJob.



25
26
27
# File 'lib/undertow/configuration.rb', line 25

def queue_name
  @queue_name
end

#storeObject

# In-memory (test / single-process dev)

Undertow.configure do |c|
  c.store = Undertow::Store::MemoryStore.new
end


19
20
21
# File 'lib/undertow/configuration.rb', line 19

def store
  @store
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