Class: RubyReactor::Executor::GraphManager

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby_reactor/executor/graph_manager.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(reactor_class, dependency_graph, context) ⇒ GraphManager

Returns a new instance of GraphManager.



8
9
10
11
12
# File 'lib/ruby_reactor/executor/graph_manager.rb', line 8

def initialize(reactor_class, dependency_graph, context)
  @reactor_class = reactor_class
  @dependency_graph = dependency_graph
  @context = context
end

Instance Attribute Details

#dependency_graphObject (readonly)

Returns the value of attribute dependency_graph.



6
7
8
# File 'lib/ruby_reactor/executor/graph_manager.rb', line 6

def dependency_graph
  @dependency_graph
end

Instance Method Details

#build_and_validate!Object



14
15
16
17
# File 'lib/ruby_reactor/executor/graph_manager.rb', line 14

def build_and_validate!
  build_dependency_graph
  validate_graph!
end

#mark_completed_steps_from_contextObject



19
20
21
22
23
# File 'lib/ruby_reactor/executor/graph_manager.rb', line 19

def mark_completed_steps_from_context
  @context.intermediate_results.each_key do |step_name|
    @dependency_graph.complete_step(step_name)
  end
end