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

    Interface DurabilityBackend

    A durability backend: the two journals plus optional lifecycle.

    interface DurabilityBackend {
        inbox: InboxJournal;
        outbox: OutboxJournal;
        exclusive?: boolean;
        scope?(name: string): DurabilityBackend;
        start?(): Promise<void>;
        stop?(): Promise<void>;
    }

    Hierarchy (View Summary)

    Implemented by

    Index
    exclusive?: boolean

    true when only one process can use the backend at a time (memory, file). A restarted process then knows every lease of its instanceId is its own dead incarnation's.

    • A view of the same storage holding only the records of name. The bot opens the view of its namespace (tenant, environment, bot, connection), so several bots can share one backend: each claims, replays and deduplicates only its own records, and explicit idempotency keys are per bot. A backend without scope must not be shared between bots.

      Parameters

      • name: string

      Returns DurabilityBackend

    • Called by bot.start() before anything is replayed.

      Returns Promise<void>

    • Called by bot.stop() after the provider stopped.

      Returns Promise<void>