Anchorage API reference
    Preparing search index...
    interface ResumeLedger {
        counts(runKey: string): Promise<ReadonlyMap<string, number> | undefined>;
        delete(runKey: string): Promise<void>;
        increment(
            runKey: string,
            stepKey: string,
            prior?: ReadonlyMap<string, number>,
        ): Promise<ReadonlyMap<string, number>>;
    }

    Implemented by

    Index

    Methods

    • stepKey -> prior resume count for the run; undefined when the run has no recorded resumes. Read BEFORE an increment, the count is the ordinal of the suspension currently being resumed (undefined = first suspension).

      Parameters

      • runKey: string

      Returns Promise<ReadonlyMap<string, number> | undefined>

    • Record one more resume of stepKey; resolves to the run's updated counts. prior is a read-elision hint: the run's current counts as read by counts() under the SAME per-run lock, with nothing writing in between (an empty map when the run has none). An I/O-backed ledger uses it to skip re-reading what the lock guarantees unchanged; implementations with free reads may ignore it. Omit when no such fresh read exists.

      Parameters

      • runKey: string
      • stepKey: string
      • Optionalprior: ReadonlyMap<string, number>

      Returns Promise<ReadonlyMap<string, number>>