Documentation
¶
Overview ¶
Package graph runs a function over a dependency DAG with bounded concurrency.
Independent branches run in parallel; a node runs only after all of its dependencies have succeeded. If a dependency fails (or is skipped), the node is skipped too, but independent branches keep going — fail-fast per branch, not globally. The caller inspects the returned per-node results.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Reverse ¶
Reverse flips edge direction: if a depends on b in deps, then in the result b depends on a. Used to uninstall in reverse dependency order.
func Run ¶
func Run(ctx context.Context, deps map[string][]string, concurrency int, fn func(context.Context, string) error) map[string]Result
Run executes fn for every node, where deps[node] lists the nodes that must succeed before it. concurrency bounds how many fn calls run at once (<=0 means no limit). The dependency graph must be acyclic (validated upstream); a cycle would deadlock. Run returns a result per node and never returns early.