Documentation
¶
Overview ¶
Package faninmap derives the fan-out -> fan-in convergence map of a workflow graph: which node a given fan-out source's branches converge on.
fanIn := faninmap.New(graph) target := fanIn.For(sourceTask) // "" when the source converges nowhere
It answers the one question an EMPTY fan-out cohort raises - a cohort with no branches has nobody to arrive at the fan-in, so the engine routes it there directly. A populated cohort converges through ordinary arrival accounting and never asks.
The map is a pure function of the graph's structure, so it is derived rather than stored: build it once per parsed graph and keep it beside that parse. It expects a graph that has already passed workflow.Graph.Validate and guards none of the shapes Validate rejects. A Map is read-only once built and safe for concurrent use.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Map ¶
type Map struct {
// contains filtered or unexported fields
}
Map is the fan-out -> fan-in convergence lookup for one graph.
func New ¶
New computes the fan-in map of a validated graph by walking its lineage: each branch of a fan-out pushes a frame identifying its source, and reaching a fan-in node pops the nearest frame and records that source -> fan-in mapping. Mirrors the lineage bookkeeping workflow.Graph.Validate performs to check convergence, but keeps only the resulting map.