Class: SolidQueue::Dispatcher
- Inherits:
-
Processes::Base
- Object
- Processes::Base
- SolidQueue::Dispatcher
- Includes:
- Processes::Poller
- Defined in:
- lib/solid_queue/dispatcher.rb
Defined Under Namespace
Classes: ConcurrencyMaintenance, RecurringSchedule, RecurringTask
Instance Attribute Summary collapse
-
#batch_size ⇒ Object
Returns the value of attribute batch_size.
-
#concurrency_maintenance ⇒ Object
Returns the value of attribute concurrency_maintenance.
-
#recurring_schedule ⇒ Object
Returns the value of attribute recurring_schedule.
Instance Method Summary collapse
-
#initialize(**options) ⇒ Dispatcher
constructor
A new instance of Dispatcher.
- #metadata ⇒ Object
Methods included from Processes::Runnable
Methods included from Processes::Supervised
Methods inherited from Processes::Base
Methods included from AppExecutor
#handle_thread_error, #wrap_in_app_executor
Methods included from Processes::Interruptible
Methods included from Processes::Procline
Constructor Details
#initialize(**options) ⇒ Dispatcher
Returns a new instance of Dispatcher.
12 13 14 15 16 17 18 19 20 |
# File 'lib/solid_queue/dispatcher.rb', line 12 def initialize(**) = .dup.with_defaults(SolidQueue::Configuration::DISPATCHER_DEFAULTS) @batch_size = [:batch_size] @polling_interval = [:polling_interval] @concurrency_maintenance = ConcurrencyMaintenance.new([:concurrency_maintenance_interval], [:batch_size]) if [:concurrency_maintenance] @recurring_schedule = RecurringSchedule.new([:recurring_tasks]) end |
Instance Attribute Details
#batch_size ⇒ Object
Returns the value of attribute batch_size.
7 8 9 |
# File 'lib/solid_queue/dispatcher.rb', line 7 def batch_size @batch_size end |
#concurrency_maintenance ⇒ Object
Returns the value of attribute concurrency_maintenance.
7 8 9 |
# File 'lib/solid_queue/dispatcher.rb', line 7 def concurrency_maintenance @concurrency_maintenance end |
#recurring_schedule ⇒ Object
Returns the value of attribute recurring_schedule.
7 8 9 |
# File 'lib/solid_queue/dispatcher.rb', line 7 def recurring_schedule @recurring_schedule end |
Instance Method Details
#metadata ⇒ Object
22 23 24 |
# File 'lib/solid_queue/dispatcher.rb', line 22 def super.merge(batch_size: batch_size, concurrency_maintenance_interval: concurrency_maintenance&.interval, recurring_schedule: recurring_schedule.tasks.presence) end |