Class: Procrastinate::ProcessManager::ChildProcess
- Inherits:
-
Struct
- Object
- Struct
- Procrastinate::ProcessManager::ChildProcess
- Defined in:
- lib/procrastinate/process_manager/child_process.rb
Overview
A <completion handler, result> tuple that stores the handler to call when a child exits and the object that will handle child-master communication if desired.
Instance Attribute Summary collapse
-
#handler ⇒ Object
Returns the value of attribute handler.
-
#result ⇒ Object
Returns the value of attribute result.
-
#state ⇒ Object
Returns the value of attribute state.
Instance Method Summary collapse
-
#call_completion_handlers ⇒ Object
Calls the completion handler for the child.
-
#incoming_message(obj) ⇒ Object
Handles incoming messages from the tasks process.
Instance Attribute Details
#handler ⇒ Object
Returns the value of attribute handler
5 6 7 |
# File 'lib/procrastinate/process_manager/child_process.rb', line 5 def handler @handler end |
#result ⇒ Object
Returns the value of attribute result
5 6 7 |
# File 'lib/procrastinate/process_manager/child_process.rb', line 5 def result @result end |
#state ⇒ Object
Returns the value of attribute state
5 6 7 |
# File 'lib/procrastinate/process_manager/child_process.rb', line 5 def state @state end |
Instance Method Details
#call_completion_handlers ⇒ Object
Calls the completion handler for the child. This is triggered by the transition into the ‘dead’ state.
16 17 18 19 |
# File 'lib/procrastinate/process_manager/child_process.rb', line 16 def call_completion_handlers result.process_died if result handler.call if handler end |
#incoming_message(obj) ⇒ Object
Handles incoming messages from the tasks process.
23 24 25 |
# File 'lib/procrastinate/process_manager/child_process.rb', line 23 def (obj) result.(obj) if result end |