Class: SolidQueue::Supervisor
- Inherits:
-
Processes::Base
- Object
- Processes::Base
- SolidQueue::Supervisor
- Includes:
- LifecycleHooks, Maintenance, Pidfiled, Signals
- Defined in:
- lib/solid_queue/supervisor.rb,
lib/solid_queue/supervisor/signals.rb,
lib/solid_queue/supervisor/pidfiled.rb
Defined Under Namespace
Modules: Maintenance, Pidfiled, Signals Classes: Pidfile
Instance Attribute Summary
Attributes inherited from Processes::Base
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(configuration) ⇒ Supervisor
constructor
A new instance of Supervisor.
- #start ⇒ Object
- #stop ⇒ Object
Methods inherited from Processes::Base
#hostname, #kind, #metadata, #pid
Methods included from AppExecutor
#handle_thread_error, #wrap_in_app_executor
Methods included from Processes::Registrable
Methods included from Processes::Interruptible
Methods included from Processes::Procline
Constructor Details
#initialize(configuration) ⇒ Supervisor
Returns a new instance of Supervisor.
21 22 23 24 25 26 27 |
# File 'lib/solid_queue/supervisor.rb', line 21 def initialize(configuration) @configuration = configuration @forks = {} @configured_processes = {} super end |
Class Method Details
.start(**options) ⇒ Object
9 10 11 12 13 14 15 16 17 18 |
# File 'lib/solid_queue/supervisor.rb', line 9 def start(**) SolidQueue.supervisor = true configuration = Configuration.new(**) if configuration.configured_processes.any? new(configuration).tap(&:start) else abort "No workers or processed configured. Exiting..." end end |
Instance Method Details
#start ⇒ Object
29 30 31 32 33 34 35 36 37 |
# File 'lib/solid_queue/supervisor.rb', line 29 def start boot run_start_hooks start_processes launch_maintenance_task supervise end |
#stop ⇒ Object
39 40 41 42 |
# File 'lib/solid_queue/supervisor.rb', line 39 def stop super run_stop_hooks end |