evoq_decision_actor (evoq v1.23.0)
View SourceStateful per-node Decision/Context actor (Part B).
The transient aggregate for a dynamic boundary. For a keyed, hot consistency boundary (one seat, one account, one SKU) this actor:
1. Serialises commands for the boundary at one process, so the store's append condition passes first try instead of N-1 context_changed retries. 2. Caches the folded decision model (or the raw context events) and updates it incrementally after each successful append — no full context re-read per command.
It is a per-node cache + serialiser, NEVER the correctness authority: reckon-db's append_if_no_tag_matches/4 stays the sole source of truth. A second node, a different decision sharing the boundary's tags, or a direct append can still write — so on context_changed the actor invalidates its cache, re-reads context, and retries. It never trusts its cache as truth.
Opt in by implementing evoq_decision:boundary_key/1. Absent ⇒ the stateless optimistic runtime (evoq_decision_runtime) handles it.
Context is loaded LAZILY on the first decide: the actor is keyed by boundary, but context/1 takes a command. Contract: for a given boundary_key, context/1 must resolve to the same filter for every command (see evoq_decision:boundary_key/1 docs).
Summary
Functions
Start an actor for the {Module, Key} boundary.