Class: SolidQueue::Dispatcher

Inherits:
Processes::Poller show all
Defined in:
lib/solid_queue/dispatcher.rb

Defined Under Namespace

Classes: ConcurrencyMaintenance

Instance Attribute Summary collapse

Attributes inherited from Processes::Poller

#polling_interval

Attributes inherited from Processes::Base

#name

Instance Method Summary collapse

Methods included from Processes::Runnable

#start, #stop

Methods included from Processes::Supervised

#supervised_by

Methods inherited from Processes::Base

#hostname, #kind, #pid, #stop

Methods included from AppExecutor

#handle_thread_error, #wrap_in_app_executor

Methods included from Processes::Registrable

#process_id

Methods included from Processes::Interruptible

#wake_up

Methods included from Processes::Procline

#procline

Constructor Details

#initialize(**options) ⇒ Dispatcher

Returns a new instance of Dispatcher.



10
11
12
13
14
15
16
17
18
# File 'lib/solid_queue/dispatcher.rb', line 10

def initialize(**options)
  options = options.dup.with_defaults(SolidQueue::Configuration::DISPATCHER_DEFAULTS)

  @batch_size = options[:batch_size]

  @concurrency_maintenance = ConcurrencyMaintenance.new(options[:concurrency_maintenance_interval], options[:batch_size]) if options[:concurrency_maintenance]

  super(**options)
end

Instance Attribute Details

#batch_sizeObject

Returns the value of attribute batch_size.



5
6
7
# File 'lib/solid_queue/dispatcher.rb', line 5

def batch_size
  @batch_size
end

#concurrency_maintenanceObject

Returns the value of attribute concurrency_maintenance.



5
6
7
# File 'lib/solid_queue/dispatcher.rb', line 5

def concurrency_maintenance
  @concurrency_maintenance
end

Instance Method Details

#metadataObject



20
21
22
# File 'lib/solid_queue/dispatcher.rb', line 20

def 
  super.merge(batch_size: batch_size, concurrency_maintenance_interval: concurrency_maintenance&.interval)
end