ReactiveDag.Cell (reactive_dag v0.17.0-rc.40)

Copy Markdown View Source

One node in the DAG — the domain-neutral IR both host apps compile down to.

A cell is either a leaf (inputs: [], leaf?: true; fed by an external source) or a derived node computed from inputs.

op is an OPTIONAL free-atom label and pure DOCUMENTATION: nothing dispatches on it. How a cell recomputes is decided by what the node DECLARED — the meta shape (reduce/join/aggregate/per_key/union/run/compute) that ReactiveDag.Node.Recompute reads. An author may leave op nil.

It was briefly load-bearing for a set-based strategy that mapped op → a host SQL template. That strategy is gone: what varied between hosts turned out to be data the DSL can declare, not a dispatch table, so there is one engine and op is a label on it again.

meta is an open map for app-specific data the compiler wants to carry (compute module, SQL template name, key_rule tag, …). The substrate passes it through untouched.

Summary

Types

id()

@type id() :: String.t()

t()

@type t() :: %ReactiveDag.Cell{
  id: id(),
  inputs: [id()],
  leaf?: boolean(),
  meta: map(),
  op: atom() | nil
}