ReactiveDag.Cell (reactive_dag v0.16.0)

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, NOT a fixed enum and NOT required. The substrate never interprets it; how a cell recomputes is decided by the app's RecomputeStrategy. Two patterns exist:

  • The ReactiveDag.Node surface dispatches on meta shape (reduce/join/ aggregate/compute), so op there is pure documentation — an author may leave it nil.
  • A set-based RecomputeStrategy MAY dispatch on op (see ReactiveDag.SetOp, which maps op → a host SQL template). op is load-bearing only for such a strategy; it exists as a field so that seam has somewhere to read.

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
}