adk_invocation_ledger_mnesia (erlang_adk v0.7.0)

View Source

Mnesia-backed durable invocation ledger.

The table uses disc_copies on the local node by default. A deployment may replicate the table with normal Mnesia administration. Lease time is the authoritative write fence on every node: an owner may mutate a running invocation only while Now < lease_until. Local process liveness is used only as an early-release optimization, so a dead local owner can be replaced before expiry; a live local pid never extends an expired lease.

Summary

Functions

checkpoint(Handle, InvocationId, OwnerToken, Checkpoint, Now, LeaseMs)

claim(Handle, InvocationId, OwnerPid, OwnerToken, Now, LeaseMs)

create(Handle, InvocationId, Metadata, Checkpoint)

delete(Handle, InvocationId)

finish(Handle, InvocationId, OwnerToken, Phase, Outcome, Checkpoint, Now)

get(Handle, InvocationId)

init(Opts)

Ensure Mnesia and the durable ledger table are available. table is primarily useful for isolated applications/tests; it must be an existing atom and always uses the record schema above.

renew(Handle, InvocationId, OwnerToken, Now, LeaseMs)