Node
A Node is a vertex in a Computation Graph. It is coupled to its graph — a node has no meaning outside one; the graph’s topology defines what each node receives and where its output goes.
- Entry node — reads one or more named sources from the cache. In Rust it
takes
Option<&T>per source (theOptionisNoneuntil that source is populated); in Python it receives the owned value. - Processing node — takes its upstream node’s output (
&Tin Rust, owned in Python) and returns a new value. - Terminal node — the node with no downstream; its return value is the graph’s result.
// entry node: reads the "orderbook" source
pub async fn ingest(orderbook: Option<&OrderBookSnapshot>) -> SpreadSignal { /* ... */ }
// processing/terminal node: takes its upstream's output
pub async fn format_output(input: &SpreadSignal) -> FormattedOutput { /* ... */ }
@cloaca.node
def ingest(orderbook): # entry: receives the owned source value
return spread_signal(orderbook)
@cloaca.node
def format_output(ingest): # processing: parameter name = upstream node
return formatted(ingest)
Routing nodes return a (variant_name, value) tuple; the variant selects the
downstream route.
- Computation Graph — nodes only exist inside one.
- Boundary event — what populates an entry node’s source.