evoq_decision_registry (evoq v1.23.0)

View Source

pg-based registry for stateful decision actors (Part B).

Mirrors evoq_aggregate_registry, but keyed on {decision, Module, Key} and in its OWN pg scope (evoq_decision_pg) — kept separate from the aggregate scope for clarity (proposal open-question 1 = "separate").

Like the aggregate registry, lookup is node-local: each node may hold its own actor for the same boundary. Cluster-wide correctness comes from reckon-db's append condition, not from the actor being unique.

Summary

Functions

Get the existing actor for {Module, Key} or start one.

Look up the node-local actor for {Module, Key}.

Register a decision actor for {Module, Key}.

Start the decision registry (and its pg scope).

Unregister a decision actor for {Module, Key}.

Functions

get_or_start(Module, Key, StoreId)

-spec get_or_start(module(), binary(), atom()) -> {ok, pid()} | {error, term()}.

Get the existing actor for {Module, Key} or start one.

lookup(Module, Key)

-spec lookup(module(), binary()) -> {ok, pid()} | {error, not_found}.

Look up the node-local actor for {Module, Key}.

register(Module, Key, Pid)

-spec register(module(), binary(), pid()) -> ok.

Register a decision actor for {Module, Key}.

start_link()

-spec start_link() -> {ok, pid()} | {error, term()}.

Start the decision registry (and its pg scope).

unregister(Module, Key)

-spec unregister(module(), binary()) -> ok.

Unregister a decision actor for {Module, Key}.