Documentation
    Preparing search index...

    Function createCacheService

    • Create a cache service that wraps an existing cache implementation as a ServiceHandler.

      Cache relay.subscribe subscriptions are one-shot — they query, deliver results, send EOSE, and are done. No long-lived subscription tracking needed. Cache query failures are best-effort: EOSE is sent even on failure.

      Parameters

      Returns ServiceHandler

      A ServiceHandler ready for runtime.registerService('cache', handler)

      import { createCacheService } from '@kehto/services';

      const cache = createCacheService({
      query: (f) => workerRelay.query(f),
      store: (e) => workerRelay.store(e),
      isAvailable: () => workerRelay.ready,
      });
      runtime.registerService('cache', cache);