class Dynflow::Executors::Parallel::FlowManager
Attributes
cursor_index[R]
execution_plan[R]
Public Class Methods
new(execution_plan, flow)
click to toggle source
# 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
Public Instance Methods
done?()
click to toggle source
# File lib/dynflow/executors/parallel/flow_manager.rb, line 16 def done? @cursor.done? end
start()
click to toggle source
@return [Set] of steps to continue with
# 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)
click to toggle source
@return [Set] of steps to continue with
# 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
Private Instance Methods
build_root_cursor()
click to toggle source
# File lib/dynflow/executors/parallel/flow_manager.rb, line 37 def build_root_cursor # the root cursor has to always run against sequence sequence = @flow.is_a?(Flows::Sequence) ? @flow : Flows::Sequence.new([@flow]) return SequenceCursor.new(self, sequence, nil) end