Documentation
¶
Overview ¶
Package dag provides a small action-oriented directed acyclic graph.
Nodes are Nexss actions. Compile validates dependencies and produces deterministic execution layers. Execute runs each layer with cancellation and merges results only at layer boundaries.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrSuspended = errors.New("graph: execution suspended for human intervention")
ErrSuspended signals that a node has paused execution (e.g. awaiting human approval). Returning this error preserves partial state so it can be saved to persistent storage.
var GlobalTopology = &TopologyRegistry{}
Functions ¶
func GetNodeOutput ¶
GetNodeOutput reads a node result using the allocation-free direct type path.
Types ¶
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
type DAG ¶
type DAG struct {
// contains filtered or unexported fields
}
type NodeContext ¶
type NodeContext struct {
// Input is the read-only, frozen state from preceding layers.
//
// ⚠️ WARNING: Because DAG state utilizes sync.Pool for memory efficiency,
// you MUST NOT read from Input after your node's handler function returns.
// Spawning detached goroutines that access Input beyond the lifecycle of
// this function will result in use-after-free panics or silent data corruption
// when the state is recycled and reused by subsequent graph executions.
Input *State
Key string // Designated output key for this node
}
NodeContext provides execution context to a DAG node.
type State ¶
type State struct {
// contains filtered or unexported fields
}
State is an immutable-by-convention view of graph state.
func AcquireState ¶
func AcquireState() *State
AcquireState retrieves a State instance from the memory pool.
type TopologyRegistry ¶
type TopologyRegistry struct {
// contains filtered or unexported fields
}
func (*TopologyRegistry) Register ¶
func (t *TopologyRegistry) Register(from, to, channel, protocol string)
func (*TopologyRegistry) ToMermaid ¶
func (t *TopologyRegistry) ToMermaid() string