adk_memory_outbox (erlang_adk v0.10.0)
View SourceBounded 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.
Constant-row readiness check for health probes.
Ensure durable tables exist and reconcile admission counters from jobs.
Delete terminal records older than the configured retention window. Work is explicitly bounded and active records are never touched.
Explicit delivery and clustering guarantees for operators.
Pure cluster-topology validation used by startup and health tests.
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.
Constant-row readiness check for health probes.
Unlike stats/1, this never folds a jobs table. It verifies the fixed table schemas and topology, then performs point reads plus a single sentinel write in one transaction. Runtime health can therefore remain independent of the number of retained jobs.
Ensure durable tables exist and reconcile admission counters from jobs.
Delete terminal records older than the configured retention window. Work is explicitly bounded and active records are never touched.
Explicit delivery and clustering guarantees for operators.
Pure cluster-topology validation used by startup and health tests.