Implements
Constructors
Constructor
Returns
MemoryScheduleStore
Methods
get()
Parameters
Returns
Promise<ScheduleRecord | null>
Implementation of
ScheduleStore.get
register()
kind and spec, keep it
untouched (that is how a restart keeps its nextRunAt); if either differs, overwrite
kind, spec and nextRunAt with the given ones (the fencing token is kept). Returns
the stored record.
Parameters
Returns
Promise<ScheduleRecord>
Implementation of
ScheduleStore.register
claimDue()
nextRunAt !== null && nextRunAt <= now and the
record has no live lease (leaseUntil absent or <= now). Then it sets
leaseOwner = owner, leaseUntil = now + leaseMs and increments fencingToken.
Returns null otherwise (not due, leased elsewhere, or unknown id).
Parameters
Returns
Promise<ClaimResult | null>
Implementation of
ScheduleStore.claimDue
renew()
leaseUntil only if fencingToken still matches; false means the lease was lost.
Parameters
Returns
Promise<boolean>
Implementation of
ScheduleStore.renew
complete()
fencingToken still matches: write the patch, clear the
lease and set updatedAt = now. false when stale (claimed again since) or deleted.
Parameters
Returns
Promise<boolean>
Implementation of
ScheduleStore.complete
delete()
register() of the same id starts from it, so tokens never go backwards per id.
Parameters
Returns
Promise<void>
Implementation of
ScheduleStore.delete
list()
Returns
Promise<ScheduleRecord[]>
Implementation of
ScheduleStore.list