Module: SolidQueue::Processes::Runnable
- Includes:
- Supervised
- Defined in:
- lib/solid_queue/processes/runnable.rb
Instance Attribute Summary collapse
-
#mode ⇒ Object
writeonly
Sets the attribute mode.
Instance Method Summary collapse
Methods included from Supervised
Instance Attribute Details
#mode=(value) ⇒ Object
Sets the attribute mode
7 8 9 |
# File 'lib/solid_queue/processes/runnable.rb', line 7 def mode=(value) @mode = value end |
Instance Method Details
#alive? ⇒ Boolean
28 29 30 |
# File 'lib/solid_queue/processes/runnable.rb', line 28 def alive? !running_async? || @thread&.alive? end |
#start ⇒ Object
9 10 11 12 13 14 |
# File 'lib/solid_queue/processes/runnable.rb', line 9 def start run_in_mode do boot run end end |
#stop ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/solid_queue/processes/runnable.rb', line 16 def stop super wake_up # When not supervised, block until the thread terminates for backward # compatibility with code that expects stop to be synchronous. # When supervised, the supervisor controls the shutdown timeout. unless supervised? @thread&.join end end |