faninmap

package
v0.10.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 3, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

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

func New(g *workflow.Graph) *Map

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.

func (*Map) For

func (fim *Map) For(source string) string

For returns the fan-in node that pops the frame pushed by the fan-out at source, or "" if source is not a fan-out with a downstream fan-in.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL