Class: Datadog::Configuration::DependencyResolver

Inherits:
Object
  • Object
show all
Includes:
TSort
Defined in:
lib/ddtrace/configuration/dependency_resolver.rb

Overview

Resolver performs a topological sort over the dependency graph

Instance Method Summary collapse

Constructor Details

#initialize(dependency_graph = {}) ⇒ DependencyResolver

Returns a new instance of DependencyResolver.



9
10
11
# File 'lib/ddtrace/configuration/dependency_resolver.rb', line 9

def initialize(dependency_graph = {})
  @dependency_graph = dependency_graph
end

Instance Method Details

#tsort_each_child(node, &blk) ⇒ Object



17
18
19
# File 'lib/ddtrace/configuration/dependency_resolver.rb', line 17

def tsort_each_child(node, &blk)
  @dependency_graph.fetch(node).each(&blk)
end

#tsort_each_node(&blk) ⇒ Object



13
14
15
# File 'lib/ddtrace/configuration/dependency_resolver.rb', line 13

def tsort_each_node(&blk)
  @dependency_graph.each_key(&blk)
end