There is an ongoing outage on the primary CPAN mirror. It is possible to work around the issue by using MetaCPAN as a mirror.

NAME

Resource::Silo::Metadata::DAG - Generic directed (acyclic) graph for dependency tracking

DESCRIPTION

This class is an internal part of Resource::Silo and is subject to change. Its main purpose is to track incomplete resources and detect dependency loops.

ATTRIBUTES

  • edges_out

  • edges_in

METHODS

size

Number of vertices in the graph.

list

Lists vertices.

list_sinks

List only vertices with no outgoing edges.

list_predecessors(\@list)

Given a list of vertices, return the list of all their predecessors without the vertices themselves.

contains($name)

Returns true if a vertex named $name is present.

add_edges (\@from, \@to)

Add edges from first vertex to the following ones.

drop_sink_cascade($name)

If $name is a sink, remove it along with any vertex which becomes a sink as a result of the operation, propagating along the edges.

Otherwise do nothing.

find_loop ($start, \@list, \%seen)

Find out whether calling $self->add_dependency([$start], $list) would cause a loop in the graph.

Due to the usage scenario, it's disjoint from adding vertices/edges.

self_check

Check the internal structure of the graph, returning undef if its intact, or an arrayref containing the list of discrepancies otherwise.

SEE ALSO

Graph.