Interface IRunStore

The run's row. An implementation keeps every field of it, the manager's timers (leaveCommandedAt, captureSuspendedAt, aloneSince) among them: the manager keeps nothing about a run in process. An implementation seals meetingUrl and creationContext at rest.

interface IRunStore {
    forget?(runId): Promise<void>;
    insert(run): Promise<void>;
    get(runId): Promise<undefined | MeetingRunRecord>;
    update(runId, patch, expectState?): Promise<undefined | MeetingRunRecord>;
    updateWith?(runId, patchFor): Promise<undefined | MeetingRunRecord>;
    replace(run): Promise<void>;
    list(filter): Promise<MeetingRunRecord[]>;
    findByIdempotencyKey(ownerRef, key): Promise<undefined | MeetingRunRecord>;
    listFundingPending?(limit, afterRunId?): Promise<MeetingRunRecord[]>;
}

Implemented by

Methods

  • Optional whole-run eviction for in-memory hosts after terminal cleanup and the retention grace. Durable stores omit it to retain their records. Call only after producers have stopped; forgetting removes fences too.

    Parameters

    • runId: string

    Returns Promise<void>

  • Optional. Re-reads the row and applies the patch patchFor makes of it, atomically as update is: the patch is decided on the row as the store holds it when it writes, so a write another caller made since an earlier read is never overwritten by a patch decided on that read. Nothing is written when patchFor answers undefined, and then undefined is answered, as it is for a run that does not exist. patchFor runs while the row is held, so it is synchronous and does no I/O. The manager decides with it a usage report's time and total against the last ones taken, and a silent run's end against the run's last usage, so a manager given usageSilenceMs refuses a run store without it: a read and a later update would let another write slip between them.

    Parameters

    Returns Promise<undefined | MeetingRunRecord>