adk_memory_erasure_epoch (erlang_adk v0.10.0)

View Source

Durable 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

advance(Scope)

-spec advance(adk_memory_service:scope()) -> {ok, non_neg_integer()} | {error, term()}.

advance(Table, Scope)

-spec advance(atom(), adk_memory_service:scope()) -> {ok, non_neg_integer()} | {error, term()}.

advance_tx(Table, Scope)

-spec advance_tx(atom(), adk_memory_service:scope()) -> non_neg_integer().

Advance inside the caller's Mnesia transaction.

assert_tx(Table, Scope, Expected)

-spec assert_tx(atom(), adk_memory_service:scope(), non_neg_integer()) -> ok.

Abort the current transaction if the captured fence is stale.

current(Scope)

-spec current(adk_memory_service:scope()) -> {ok, non_neg_integer()} | {error, term()}.

current(Table, Scope)

-spec current(atom(), adk_memory_service:scope()) -> {ok, non_neg_integer()} | {error, term()}.

current_tx(Table, Scope)

-spec current_tx(atom(), adk_memory_service:scope()) -> non_neg_integer().

Read inside the caller's Mnesia transaction.

current_tx(Table, Scope, Lock)

-spec current_tx(atom(), adk_memory_service:scope(), read | write) -> non_neg_integer().

default_table()

-spec default_table() -> atom().

ensure_table()

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

ensure_table(Table)

-spec ensure_table(atom()) -> ok | {error, term()}.