@adcp/sdk API Reference - v10.0.1
    Preparing search index...

    Function createLazyBackend

    • Lazily resolve an idempotency backend on first use.

      Use this when the real backend depends on application infrastructure that is resolved asynchronously after SDK server construction, for example:

      const store = createIdempotencyStore({
      backend: createLazyBackend(async () => redisBackend(await getRedisClient(), { keyPrefix })),
      });

      Concurrent first calls share a single factory invocation. If the factory fails, the wrapper forgets that failed attempt so a later call can retry.

      clearAll() is not exposed by default because its presence is used by compliance reset code as the backend's explicit "safe to flush" signal. Set { clearAll: true } only when every backend the factory can return supports and safely permits bulk clearing.

      Parameters

      Returns IdempotencyBackend