adk_memory_outbox (erlang_adk v0.7.0)

View Source

Bounded Mnesia outbox for asynchronous long-term-memory ingestion.

Jobs contain exact application/user/session and {Module, StableId} adapter identities, canonical sanitized events, and a durable batch checkpoint. No runtime pid, credential, resolver state, or service handle is persisted.

Claims are lease-fenced and retries are at-least-once. A processor can repeat a batch after an uncertain crash; the memory adapter's event-ID idempotency is what deduplicates effects. This module does not claim distributed exactly-once delivery.

Summary

Functions

Claim one due batch. OwnerToken is an unguessable runtime binary; unlike a pid it is safe to persist as a lease fence.

Durably admit a job. This performs only a bounded local transaction; adapter resolution and ingestion are always left to a processor.

Ensure durable tables exist and reconcile admission counters from jobs.

Functions

cancel(Handle, JobId, Reason0)

claim_due(Handle, OwnerToken, Now, LeaseMs)

Claim one due batch. OwnerToken is an unguessable runtime binary; unlike a pid it is safe to persist as a lease fence.

complete_batch(Handle, JobId, OwnerToken, Result0, Now)

default_config()

delete(Handle, JobId)

enqueue(Handle, Request)

Durably admit a job. This performs only a bounded local transaction; adapter resolution and ingestion are always left to a processor.

init(Config)

Ensure durable tables exist and reconcile admission counters from jobs.

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

retry(Handle, JobId, OwnerToken, Reason0, Now)

stats(Handle)

status(Handle, JobId)

table_names(_)