Metreeca Keep
    Preparing search index...

    Request-submission surface over the batching handlers.

    Brokers each store request (detection, lookup, selection, modification) to its handler: a call enqueues the request and returns a promise that settles with the request's result. Held both by outside callers, as the entry point, and by handlers, to delegate nested work to a sibling handler.

    type Broker = {
        detect(request: Detect): Promise<boolean>;
        lookup<T extends Template>(request: Lookup<T>): Promise<Instance<T>>;
        select<T extends Query>(request: Select<T>): Promise<Instance<T>>;
        modify(request: Modify): Promise<string>;
    }
    Index

    Methods

    • Enqueue a Detect request.

      Parameters

      • request: Detect

        The entry to probe

      Returns Promise<boolean>

      A promise resolving to true when the request's entry exists in the store; false otherwise

    • Enqueue a Lookup request.

      Carries no existence precondition: an entry with no stored state resolves to an empty instance of the request's model rather than rejecting.

      Type Parameters

      • T extends Template

      Parameters

      • request: Lookup<T>

        The resource and model to materialise

      Returns Promise<Instance<T>>

      A promise resolving to the materialised Instance of the request's model (the resource value), settled once the owning batch and any nested promises needed to assemble its value have resolved

    • Enqueue a Select request.

      Carries no existence precondition: an entry with no matching members resolves to an empty collection rather than rejecting.

      Type Parameters

      • T extends Query

      Parameters

      • request: Select<T>

        The property and query to materialise

      Returns Promise<Instance<T>>

      A promise resolving to the materialised Instance of the request's query (one of the tuple-wrapped Query arms), settled once the owning batch and any nested promises needed to assemble its value have resolved

    • Enqueue a Modify request.

      Mutates unconditionally, with no existence precondition: a present state upserts the entry, creating it when absent; an omitted state deletes it leniently, resolving as a no-op when absent.

      Parameters

      • request: Modify

        The entry and target state to persist

      Returns Promise<string>

      A promise resolving to the mutated entry's Reference, settled once the owning batch has completed