Class: SolidQueue::Dispatcher
- Inherits:
-
Processes::Poller
- Object
- Processes::Base
- Processes::Poller
- SolidQueue::Dispatcher
- Includes:
- LifecycleHooks
- Defined in:
- lib/solid_queue/dispatcher.rb
Defined Under Namespace
Classes: ConcurrencyMaintenance, Maintenance
Instance Attribute Summary collapse
-
#batch_size ⇒ Object
readonly
Returns the value of attribute batch_size.
Attributes inherited from Processes::Poller
Attributes inherited from Processes::Base
Instance Method Summary collapse
-
#initialize(**options) ⇒ Dispatcher
constructor
A new instance of Dispatcher.
- #metadata ⇒ Object
Methods included from Processes::Runnable
#alive?, #boot_timed_out?, #mark_as_reaped, #mode=, #start, #stop
Methods included from Processes::Supervised
Methods inherited from Processes::Base
Methods included from AppExecutor
#create_thread, #handle_thread_error, #wrap_in_app_executor
Methods included from Processes::Registrable
Methods included from Processes::Procline
Methods included from Processes::Interruptible
Constructor Details
#initialize(**options) ⇒ Dispatcher
Returns a new instance of Dispatcher.
15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/solid_queue/dispatcher.rb', line 15 def initialize(**) = .dup.with_defaults(SolidQueue::Configuration::DISPATCHER_DEFAULTS) @batch_size = [:batch_size] # Run both maintenance routines on one timer instead of another thread. if [:concurrency_maintenance] || [:batch_maintenance] @maintenance = Maintenance.new([:concurrency_maintenance_interval], [:batch_size], concurrency: [:concurrency_maintenance], batches: [:batch_maintenance]) end super(**) end |
Instance Attribute Details
#batch_size ⇒ Object (readonly)
Returns the value of attribute batch_size.
7 8 9 |
# File 'lib/solid_queue/dispatcher.rb', line 7 def batch_size @batch_size end |
Instance Method Details
#metadata ⇒ Object
29 30 31 |
# File 'lib/solid_queue/dispatcher.rb', line 29 def super.merge(batch_size: batch_size).merge(maintenance&. || {}) end |