Class: Dynflow::Executors::Parallel::FlowManager
- Inherits:
-
Object
- Object
- Dynflow::Executors::Parallel::FlowManager
- Includes:
- Algebrick::TypeCheck
- Defined in:
- lib/dynflow/executors/parallel/flow_manager.rb
Instance Attribute Summary collapse
-
#cursor_index ⇒ Object
readonly
Returns the value of attribute cursor_index.
-
#execution_plan ⇒ Object
readonly
Returns the value of attribute execution_plan.
Instance Method Summary collapse
- #done? ⇒ Boolean
-
#initialize(execution_plan, flow) ⇒ FlowManager
constructor
A new instance of FlowManager.
-
#start ⇒ Set
Of steps to continue with.
-
#what_is_next(flow_step) ⇒ Set
Of steps to continue with.
Constructor Details
#initialize(execution_plan, flow) ⇒ FlowManager
Returns a new instance of FlowManager.
9 10 11 12 13 14 |
# File 'lib/dynflow/executors/parallel/flow_manager.rb', line 9 def initialize(execution_plan, flow) @execution_plan = Type! execution_plan, ExecutionPlan @flow = flow @cursor_index = {} @cursor = build_root_cursor end |
Instance Attribute Details
#cursor_index ⇒ Object (readonly)
Returns the value of attribute cursor_index.
7 8 9 |
# File 'lib/dynflow/executors/parallel/flow_manager.rb', line 7 def cursor_index @cursor_index end |
#execution_plan ⇒ Object (readonly)
Returns the value of attribute execution_plan.
7 8 9 |
# File 'lib/dynflow/executors/parallel/flow_manager.rb', line 7 def execution_plan @execution_plan end |
Instance Method Details
#done? ⇒ Boolean
16 17 18 |
# File 'lib/dynflow/executors/parallel/flow_manager.rb', line 16 def done? @cursor.done? end |
#start ⇒ Set
Returns of steps to continue with.
29 30 31 32 33 |
# File 'lib/dynflow/executors/parallel/flow_manager.rb', line 29 def start return @cursor.what_is_next.tap do |steps| raise 'invalid state' if steps.empty? && !done? end end |
#what_is_next(flow_step) ⇒ Set
Returns of steps to continue with.
21 22 23 24 25 26 |
# File 'lib/dynflow/executors/parallel/flow_manager.rb', line 21 def what_is_next(flow_step) return [] if flow_step.state == :suspended success = flow_step.state != :error return cursor_index[flow_step.id].what_is_next(flow_step, success) end |