Implements
Constructors
Constructor
Parameters
Returns
KvInbox
Methods
append()
id. 'duplicate' means the id is already known (any state);
the existing record is returned unchanged. With lease, a new record is created
already claimed (processing, token 1, 1 attempt), so no other claimer can take it
between the append and the claim.
Parameters
Returns
Promise<{
status: "appended" | "duplicate";
record: InboxRecord;
}>
Implementation of
InboxJournal.append
claim()
pending/failed whose nextAttemptAt <= now, plus processing
records whose lease expired. Oldest receivedAt first. Each claimed record comes back
processing with a fresh fencingToken and attempts + 1.
Parameters
Returns
Promise<InboxRecord[]>
Implementation of
InboxJournal.claim
claimOne()
null when it is not.
Parameters
Returns
Promise<InboxRecord | null>
Implementation of
InboxJournal.claimOne
ack()
processing → done.
Parameters
Returns
Promise<void>
Throws
whentoken is not the current claim.
Implementation of
InboxJournal.ack
fail()
processing → failed (due at retryAt, default now) or dead (dead: true).
Parameters
Returns
Promise<void>
Throws
Implementation of
InboxJournal.fail
release()
processing → pending, due now; the claim’s attempt is not charged.
Parameters
Returns
Promise<void>
Throws
Implementation of
InboxJournal.release
extend()
Parameters
Returns
Promise<void>
Throws
Implementation of
InboxJournal.extend
replay()
pending, due now, attempts reset. No-op for an unknown id.
Parameters
Returns
Promise<void>
Implementation of
InboxJournal.replay
get()
Parameters
Returns
Promise<InboxRecord | undefined>
Implementation of
InboxJournal.get
list()
receivedAt first.
Parameters
Returns
Promise<InboxRecord[]>
Implementation of
InboxJournal.list
purge()
done records completed before doneBefore (and dead ones when includeDead). Returns the count.
Parameters
Returns
Promise<number>
Implementation of
InboxJournal.purge