/** * MemoryOutboxStore — first-party in-memory implementation of the * OutboxStore contract (src/manifest/outbox/outbox-store.ts). * * Intended use: * - Unit and conformance tests * - Local development and sample applications * - Reference for downstream durable implementations * * Durability: none. State lives in process memory only. * * Transactionality: the in-memory store ignores the `tx` argument passed to * `enqueue` — there is no shared transaction boundary in the in-memory * runtime today. Durable adapters MUST honor `tx` to inherit the * transactional outbox guarantee. * * Concurrency: a per-entry `claimed` flag stands in for SELECT … FOR UPDATE * SKIP LOCKED semantics; concurrent callers of `claim` never receive the * same entry, and entries already delivered/failed never re-appear from * `claim` regardless of status transitions. */ import type { OutboxEntry, OutboxStore } from '../outbox-store'; export interface MemoryOutboxStoreOptions { /** Provide a stable id generator for entries that arrive without one. */ generateId?: () => string; /** Wall-clock function for enqueuedAt/claimedAt/etc. Defaults to Date.now. */ now?: () => number; } export declare class MemoryOutboxStore implements OutboxStore { private entries; private seenEntryIds; private generateId; private now; constructor(opts?: MemoryOutboxStoreOptions); enqueue(entries: OutboxEntry[], _tx?: unknown): Promise; claim(batchSize: number): Promise; markDelivered(entryIds: string[]): Promise; markFailed(entryIds: string[], error: string): Promise; /** * Diagnostic helper: return a snapshot of all entries (defensive copy). * Not part of the OutboxStore contract — for tests and observability. */ list(): OutboxEntry[]; /** Number of entries currently stored. */ size(): number; /** * Release a claim without delivering or failing. Useful for tests that * need to simulate a worker crash mid-delivery. Not part of the contract. */ releaseClaim(entryIds: string[]): void; clear(): void; private exposeEntry; } //# sourceMappingURL=memory.d.ts.map