Documentation
    Preparing search index...

    Function createCoordinatedRelay

    • Create a coordinated relay service that combines relay pool and cache into a single ServiceHandler with dedup and unified EOSE.

      On relay.subscribe: queries cache first, then subscribes to relay pool. Events are deduplicated by ID. EOSE is sent after both sources complete. On relay.publish: publishes to relay pool and stores in cache. On relay.close: cancels relay pool subscription.

      Parameters

      Returns ServiceHandler

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

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

      const relay = createCoordinatedRelay({ relayPool: myPool, cache: myCache });
      runtime.registerService('relay', relay);