ReactiveDag.Node.Recompute.PerKey (reactive_dag v0.17.0-rc)

Copy Markdown View Source

Runs a per_key node: for each claimed input row, call a generic action with that row and write its structured output into this node's attributes.

The library drives the loop — scope, read, call, write — which is what makes fingerprinting possible. A run action is opaque by design (the library passes keys and gets keys back), so nothing outside it can know whether the work is worth doing. Here the library sees the input rows, so it can hash the fields the result depends on and skip the call when they are unchanged.

For an expensive or non-deterministic action — an LLM call above all — that is the difference between a whole-cell claim costing one call and costing all of them. Skips are reported on the drain's %Report{} step (%{called: n, skipped: n}), so the saving is visible rather than assumed.

Summary

Functions

Recompute a per_key node; returns {changed_keys, meta}.

Functions

recompute(cell, spec, claimed)

@spec recompute(ReactiveDag.Cell.t(), map(), [String.t()] | nil) ::
  {[String.t()], map()}

Recompute a per_key node; returns {changed_keys, meta}.