Implements
Constructors
Constructor
Parameters
Returns
KvOutbox
Methods
put()
key; on conflict the existing record is returned unchanged ('exists').
With lease, a new record is created already begun (sending, token 1, 1 attempt).
Parameters
Returns
Promise<{
status: "created" | "exists";
record: OutboxRecord;
}>
Implementation of
OutboxJournal.put
begin()
pending/failed (due or not) → sending under a fresh token: the persisted
“about to call the provider” marker. null when the record is missing or in another state.
Parameters
Returns
Promise<OutboxRecord | null>
Implementation of
OutboxJournal.begin
markSent()
sending → sent with the provider ref.
Parameters
Returns
Promise<void>
Throws
Implementation of
OutboxJournal.markSent
extend()
sending record (heartbeat while the provider call runs).
Parameters
Returns
Promise<void>
Throws
Implementation of
OutboxJournal.extend
markFailed()
sending → failed (due at retryAt) or dead. With refund, the claim made no
provider call (a split part deferred behind an earlier one): the attempt it counted is
given back, so waiting never uses up the record’s retries.
Parameters
Returns
Promise<void>
Throws
Implementation of
OutboxJournal.markFailed
claimDue()
pending/failed records and sending records whose lease expired
(returned with ambiguous: true), oldest createdAt first. Claimed records come back
sending under a fresh token.
Parameters
Returns
Promise<ClaimedSend[]>
Implementation of
OutboxJournal.claimDue
resolveAmbiguous()
'unknown' (terminal) or 'pending' (send again).
Parameters
Returns
Promise<void>
Throws
Implementation of
OutboxJournal.resolveAmbiguous
get()
Parameters
Returns
Promise<OutboxRecord | undefined>
Implementation of
OutboxJournal.get
list()
createdAt first.
Parameters
Returns
Promise<OutboxRecord[]>
Implementation of
OutboxJournal.list
retry()
failed/dead/unknown → pending, due now.
Parameters
Returns
Promise<void>
Implementation of
OutboxJournal.retry
discard()
Parameters
Returns
Promise<void>
Implementation of
OutboxJournal.discard
purge()
before. Returns the count.
Parameters
Returns
Promise<number>
Implementation of
OutboxJournal.purge