Metreeca Keep
    Preparing search index...

    Function createBatchingStore

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

      Routes every StoreClient call through a Broker that coalesces concurrent requests into batches and dispatches each batch through the matching handlers entry. Adds conditional CRUD semantics on top of the handlers: existence is probed through the detect handler before a create, update, or delete is delegated to modify, sparing each handler that bookkeeping.

      The modify handler is additionally wrapped so the batching layer, not the storage handler, enforces the §4.1 state-id constraint: a request whose state carries an id other than its entry is rejected on its own before dispatch, and a backend failure is settled as a rejection across the surviving batch rather than surfaced as a handler throw. The wrapped handler thus always receives a non-empty batch of pre-validated requests to apply unconditionally.

      Parameters

      Returns StoreClient

      An immutable StoreClient that batches its requests through the broker

      If a create or update state carries an id that differs from its entry