Cotal TypeScript packages
    Preparing search index...

    Function withControlConnection

    • Open one short-lived control connection under whichever of the three auth shapes this command holds (static creds / user bearer + sentinel / bare open mesh) and hand it to fn. Extracted so the scatter's TWO connections cannot drift in their connect options: they differ in credential and in nothing else. The selected dialer matters because the raw node transport refuses a wss:// mesh behind an HTTPS edge even when the other endpoint rails can reach it.

      Type Parameters

      • T

      Parameters

      • server: string
      • auth: ControlAuth
      • fn: (nc: NatsConnection, name: string) => Promise<T>

      Returns Promise<T>