@metreeca/keep
    Preparing search index...

    Module batching

    Batching store client.

    Lets a connector serve many concurrent store requests with few backend round-trips. Requests of the same kind are coalesced into a single batch, and the connector supplies one batch Handler per kind. The resulting StoreClient adds conditional CRUD semantics on top, so handlers apply each request unconditionally.

    Four request kinds partition the work, each with its own handler:

    • detect — probes whether each Detect entry exists in the store
    • detail — materialises each Detail resource against its model; multi-valued members reached by the model may be handed to the select handler through Broker.select
    • select — materialises each Select collection against its query; element resources reached by the query may be handed to the detail handler through Broker.detail
    • modify — creates, updates, or deletes each Modify target, or links it to a collection

    Retrieval is driven by the requested model and query, not by the stored graph. A detail handler issues a select for each multi-valued member its model reaches, and a select handler issues a detail for each element resource its query reaches. Each request thus descends exactly as deep as its model or query nests, however deep the underlying graph runs.

    Important

    Handlers run concurrently and exchange nested requests through the Broker. A handler must not assume any ordering between handlers, and must await every nested request it issues before settling the request that depends on it.

    Type Aliases

    Request

    Requests accepted by Broker.

    Response

    Result of running a Request, narrowed by request variant:

    Detect

    Resource existence request.

    Detail

    Resource retrieval request.

    Select

    Collection retrieval request.

    Modify

    Resource mutation request.

    Handler

    Batch handler for a single request type.

    Deferred

    A queued request paired with its promise-resolution hooks.

    Broker

    Request-submission surface over the batching handlers.

    Functions

    createBatchingStore

    Creates a batching store client backed by a set of request handlers.