Sha256: 000ae78aaa81b6abab6da17a6b55a0b4b409719f1abe2a57ce78325e7706832a

Contents?: true

Size: 498 Bytes

Versions: 50

Compression:

Stored size: 498 Bytes

Contents

require 'tsort'

module Datadog
  module Configuration
    # Resolver performs a topological sort over the dependency graph
    class DependencyResolver
      include TSort

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

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

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

      alias call tsort
    end
  end
end

Version data entries

50 entries across 50 versions & 2 rubygems

Version Path
ddtrace-0.51.1 lib/ddtrace/configuration/dependency_resolver.rb
ddtrace-0.51.0 lib/ddtrace/configuration/dependency_resolver.rb
ddtrace-0.50.0 lib/ddtrace/configuration/dependency_resolver.rb
ddtrace-0.49.0 lib/ddtrace/configuration/dependency_resolver.rb
ddtrace-0.48.0 lib/ddtrace/configuration/dependency_resolver.rb
ddtrace-0.47.0 lib/ddtrace/configuration/dependency_resolver.rb
ddtrace-0.46.0 lib/ddtrace/configuration/dependency_resolver.rb
ddtrace-0.45.0 lib/ddtrace/configuration/dependency_resolver.rb
ddtrace-0.44.0 lib/ddtrace/configuration/dependency_resolver.rb
ddtrace-0.43.0 lib/ddtrace/configuration/dependency_resolver.rb
ddtrace-0.42.0 lib/ddtrace/configuration/dependency_resolver.rb
ddtrace-0.41.0 lib/ddtrace/configuration/dependency_resolver.rb
ls-trace-0.2.0 lib/ddtrace/configuration/dependency_resolver.rb
ddtrace-0.40.0 lib/ddtrace/configuration/dependency_resolver.rb
ddtrace-0.39.0 lib/ddtrace/configuration/dependency_resolver.rb
ddtrace-0.38.0 lib/ddtrace/configuration/dependency_resolver.rb
ddtrace-0.37.0 lib/ddtrace/configuration/dependency_resolver.rb
ddtrace-0.36.0 lib/ddtrace/configuration/dependency_resolver.rb
ls-trace-0.1.2 lib/ddtrace/configuration/dependency_resolver.rb
ddtrace-0.35.2 lib/ddtrace/configuration/dependency_resolver.rb