@nats-io/nats-core
    Preparing search index...

    Type Alias FirstConnectFn

    FirstConnectFn: (
        failure: { attempts: number; error: Error; server: string },
    ) => boolean

    Called by the client after every failed dial while establishing its first connection (see ConnectionOptions.waitOnFirstConnect). server is the address dialed (host:port), error why the dial failed, and attempts the number of failed dials so far. Return true to keep trying, or false to stop - the connect then rejects with error. Throwing also stops, and the connect rejects with the thrown error.

    The function is synchronous: retries are paced by ConnectionOptions.reconnectTimeWait and ConnectionOptions.reconnectDelayHandler.

    Type Declaration

      • (failure: { attempts: number; error: Error; server: string }): boolean
      • Parameters

        • failure: { attempts: number; error: Error; server: string }

        Returns boolean