Skip to main content

Module dag

Module dag 

Source
Expand description

DAG scheduler.

Pure-logic state machine over a parsed pipe::Pipe. Tracks node lifecycle states, decides which nodes are ready to dispatch given the current outcomes of their predecessors, and respects each node’s trigger_rule (all_success default, one_success for synthesis nodes that should fire as soon as any single branch succeeds).

No I/O. The runner (Unit 11+) plugs the scheduler into subprocess lifecycle: call ready() to find dispatchable nodes, spawn each, then call mark(id, outcome) when subprocess termination is observed. The returned set is the newly unblocked successors so callers don’t re-scan the whole DAG every tick.

Failure semantics:

  • all_success predecessors: any failed predecessor permanently blocks the dependent.
  • one_success predecessors: the dependent becomes ready as soon as one predecessor completes successfully; remaining predecessors are no-ops once it fires. If every predecessor ends up failed, the dependent is permanently blocked.

Structs§

Scheduler
State machine over a parsed pipe. Construct once per run; thread ready() / mark() calls through the dispatcher loop.

Enums§

NodeOutcome
What mark was told about a node’s outcome.
NodeState
Lifecycle of a node inside one run.
SchedulerError