faninmap

package
v0.9.5 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 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. It is an engine-side optimization view computed from a graph's public definition, not part of the graph itself: workflow.Graph carries only the author's definition (nodes, transitions, fan-in flags), and the engine builds this lookup from it when it needs to route an empty fan-out cohort to its convergence node.

The map is a pure, deterministic function of the graph structure, so it is never persisted - the engine computes it once per flow at dispatch (caching it beside the parsed graph) rather than freezing it into the stored graph JSON. The traversal assumes an already-validated graph (workflow.Graph.Validate rejects the malformed shapes this analysis would otherwise have to guard against), so it only builds the mapping.

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