adk_memory_erasure_epoch (erlang_adk v0.10.0)
View SourceDurable application/user erasure fences.
An epoch is monotonically advanced when a user is erased. Durable work captures the current epoch at admission and adapters compare it in the same transaction as their write. This makes a stale queued or in-flight job incapable of recreating data after erasure.
Summary
Functions
Advance inside the caller's Mnesia transaction.
Abort the current transaction if the captured fence is stale.
Read inside the caller's Mnesia transaction.
Functions
-spec advance(adk_memory_service:scope()) -> {ok, non_neg_integer()} | {error, term()}.
-spec advance(atom(), adk_memory_service:scope()) -> {ok, non_neg_integer()} | {error, term()}.
-spec advance_tx(atom(), adk_memory_service:scope()) -> non_neg_integer().
Advance inside the caller's Mnesia transaction.
-spec assert_tx(atom(), adk_memory_service:scope(), non_neg_integer()) -> ok.
Abort the current transaction if the captured fence is stale.
-spec current(adk_memory_service:scope()) -> {ok, non_neg_integer()} | {error, term()}.
-spec current(atom(), adk_memory_service:scope()) -> {ok, non_neg_integer()} | {error, term()}.
-spec current_tx(atom(), adk_memory_service:scope()) -> non_neg_integer().
Read inside the caller's Mnesia transaction.
-spec current_tx(atom(), adk_memory_service:scope(), read | write) -> non_neg_integer().
-spec default_table() -> atom().
-spec ensure_table() -> ok | {error, term()}.