Engine
dagpipe.engine
Summary
Execution engine responsible for running pipelines and graphs.
The Engine executes Node objects and propagates immutable State instances
through either a linear sequence or a directed acyclic graph (Graph).
It orchestrates execution order, branching, and state propagation.
Guarantees
- Deterministic execution and consistent state lineage.
- Orchestrates execution without modifying
Graph,Node, orStateobjects.
Classes
Engine
Execution engine responsible for running pipeline logic.
Notes
Responsibilities:
1 2 3 4 | |
Guarantees:
1 2 3 4 5 | |
Initialize the execution engine.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
nodes_or_graph |
Sequence[Node] | Graph
|
Pipeline definition. May be a linear sequence or a DAG. |
required |
Raises:
| Type | Description |
|---|---|
TypeError
|
If input is not a |
Notes
Responsibilities:
1 2 | |
Attributes
nodes
property
Return nodes managed by this engine.
Returns:
| Type | Description |
|---|---|
tuple[Node, ...]
|
tuple[Node, ...]: Ordered sequence in linear mode or all nodes in graph mode. |
Functions
__repr__
Return the canonical string representation of the object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
Representation that uniquely identifies the object and its configuration. |
run
Execute the pipeline starting from a root State.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
root |
State
|
Initial execution state. |
required |
Returns:
| Type | Description |
|---|---|
List[State]
|
list[State]: Terminal execution states produced by the pipeline. |
Raises:
| Type | Description |
|---|---|
TypeError
|
If |
RuntimeError
|
If the engine execution mode is invalid. |
Notes
Responsibilities:
1 2 | |