Hierarchy

Constructors

Properties

Connection: typeof Connection
_agent: AgentOptions
_proxy: string | URL
_sniffEnabled: boolean
_ssl: SecureContextOptions
auth: BasicAuth | ApiKeyAuth
connections: Connection[]
dead: string[]
emit: ((event: string | symbol, ...args: any[]) => boolean)

Type declaration

    • (event: string | symbol, ...args: any[]): boolean
    • Parameters

      • event: string | symbol
      • Rest ...args: any[]

      Returns boolean

pingTimeout: number
resurrectStrategy: number
resurrectTimeout: number
resurrectTimeoutCutoff: number
size: number
resurrectStrategies: { none: number; optimistic: number; ping: number }

Type declaration

  • none: number
  • optimistic: number
  • ping: number

Methods

  • Returns an alive connection if present, otherwise returns a dead connection. By default it filters the master only nodes. It uses the selector to choose which connection return.

    Returns

    connection

    Parameters

    • Optional opts: getConnectionOptions

    Returns Connection

  • Transforms the nodes objects to a host object.

    Returns

    hosts

    Parameters

    • nodes: any
    • protocol: string

    Returns any[]

  • If enabled, tries to resurrect a connection with the given resurrect strategy ('ping', 'optimistic', 'none').

    Parameters

    • opts: resurrectOptions
    • Optional callback: ((isAlive: boolean, connection: Connection) => void)

      (isAlive, connection)

        • (isAlive: boolean, connection: Connection): void
        • Parameters

          Returns void

    Returns void

  • Update the ConnectionPool with new connections.

    Returns

    Parameters

    • connections: any[]

    Returns ConnectionPool

  • Transforms an url string to a host object

    Returns

    host

    Parameters

    • url: string

    Returns { url: URL }

    • url: URL

Generated using TypeDoc