Core - v1.0.0
    Preparing search index...

    Interface CoordinationStore<TRuntime>

    Strongly consistent, single-threaded state addressed by name.

    The capability for the things a cache cannot do: a counter that must not lose an increment, a lock, a session two requests may touch at once. Every call for a given name reaches the same instance, and that instance handles one request at a time — which is what makes read-modify-write safe here and unsafe in CacheStore.

    Addressing is by name rather than by handle so that callers need no discovery step: two callers that agree on a name are talking to the same state.

    Bayu Dwiyan Satria

    1.0.0

    1.0.0

    interface CoordinationStore<TRuntime = unknown> {
        call<T = unknown>(
            runtime: TRuntime,
            name: string,
            path: string,
            init?: RequestInit,
        ): Promise<T>;
        create(runtime: TRuntime): string;
        isAvailable(runtime: TRuntime): boolean;
    }

    Type Parameters

    • TRuntime = unknown

      The runtime handle the store is resolved from.

    Hierarchy (View Summary)

    Index
    • Calls the instance registered under a name.

      Type Parameters

      • T = unknown

      Parameters

      • runtime: TRuntime

        The runtime handle.

      • name: string

        Name identifying the instance.

      • path: string

        Path within the instance's own handler.

      • Optionalinit: RequestInit

        Request options — method, headers, body.

      Returns Promise<T>

      The parsed response.

    • Reports whether the capability is actually usable on this runtime.

      Parameters

      Returns boolean

      true when calls will reach a real backing resource.

      A capability backed by an optional resource answers false when that resource was never provisioned. Implementations must document what each method does in that state — degrade or throw — and must not vary it, since a caller choosing between two implementations is relying on the answer meaning the same thing in both.