Class: CapistranoMulticonfigParallel::StateMachine
- Inherits:
-
Object
- Object
- CapistranoMulticonfigParallel::StateMachine
- Includes:
- ComposableStateMachine::CallbackRunner
- Defined in:
- lib/capistrano_multiconfig_parallel/celluloid/state_machine.rb
Overview
class that handles the states of the celluloid worker executing the child process in a fork process
Instance Attribute Summary collapse
-
#initial_state ⇒ Object
Returns the value of attribute initial_state.
-
#job ⇒ Object
Returns the value of attribute job.
-
#machine ⇒ Object
Returns the value of attribute machine.
-
#model ⇒ Object
Returns the value of attribute model.
-
#output ⇒ Object
Returns the value of attribute output.
-
#state ⇒ Object
Returns the value of attribute state.
-
#transitions ⇒ Object
Returns the value of attribute transitions.
Instance Method Summary collapse
- #go_to_transition(action) ⇒ Object
-
#initialize(job, actor) ⇒ StateMachine
constructor
A new instance of StateMachine.
Constructor Details
#initialize(job, actor) ⇒ StateMachine
Returns a new instance of StateMachine.
7 8 9 10 11 12 13 |
# File 'lib/capistrano_multiconfig_parallel/celluloid/state_machine.rb', line 7 def initialize(job, actor) @job = job @actor = actor @initial_state = :unstarted @model = generate_model build_machine end |
Instance Attribute Details
#initial_state ⇒ Object
Returns the value of attribute initial_state.
5 6 7 |
# File 'lib/capistrano_multiconfig_parallel/celluloid/state_machine.rb', line 5 def initial_state @initial_state end |
#job ⇒ Object
Returns the value of attribute job.
5 6 7 |
# File 'lib/capistrano_multiconfig_parallel/celluloid/state_machine.rb', line 5 def job @job end |
#machine ⇒ Object
Returns the value of attribute machine.
5 6 7 |
# File 'lib/capistrano_multiconfig_parallel/celluloid/state_machine.rb', line 5 def machine @machine end |
#model ⇒ Object
Returns the value of attribute model.
5 6 7 |
# File 'lib/capistrano_multiconfig_parallel/celluloid/state_machine.rb', line 5 def model @model end |
#output ⇒ Object
Returns the value of attribute output.
5 6 7 |
# File 'lib/capistrano_multiconfig_parallel/celluloid/state_machine.rb', line 5 def output @output end |
#state ⇒ Object
Returns the value of attribute state.
5 6 7 |
# File 'lib/capistrano_multiconfig_parallel/celluloid/state_machine.rb', line 5 def state @state end |
#transitions ⇒ Object
Returns the value of attribute transitions.
5 6 7 |
# File 'lib/capistrano_multiconfig_parallel/celluloid/state_machine.rb', line 5 def transitions @transitions end |
Instance Method Details
#go_to_transition(action) ⇒ Object
15 16 17 |
# File 'lib/capistrano_multiconfig_parallel/celluloid/state_machine.rb', line 15 def go_to_transition(action) @machine.trigger(action.to_s) end |