@botmesh/core - v2.0.0-alpha.2
    Preparing search index...

    Interface ChatTurn

    A granted per-key turn. The holder may run the key's work until release or until signal aborts.

    interface ChatTurn {
        key: string;
        fence: number;
        previousHolder: string | null;
        signal: AbortSignal;
        assertHeld(): void;
        release(): Promise<void>;
    }
    Index
    key: string
    fence: number
    previousHolder: string | null

    Replica that held the previous turn of this key, null when unknown (first turn, or the key's history expired). When it is not this replica, any in-memory state this replica kept for the key (a waiting conversation) may be stale.

    signal: AbortSignal

    Aborts (with a LeaseLostError reason) when the turn is lost before release.

    • Hand the key to the next ticket (idempotent).

      Returns Promise<void>