Class BaseConnectionPool

Hierarchy

Constructors

  • Parameters

    • Optional opts: BaseConnectionPoolOptions

    Returns BaseConnectionPool

Properties

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

Type declaration

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

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

      Returns boolean

size: number

Methods

  • Adds a new connection to the pool.

    Returns

    Parameters

    • opts: any

    Returns Connection

  • 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

  • Marks a connection as 'alive'. If needed removes the connection from the dead list and then resets the deadCount.

    Parameters

    Returns BaseConnectionPool

  • Marks a connection as 'dead'. If needed adds the connection to the dead list and then increments the deadCount.

    Parameters

    Returns BaseConnectionPool

  • Transforms the nodes objects to a host object.

    Returns

    hosts

    Parameters

    • nodes: any
    • protocol: string

    Returns any[]

  • Update the ConnectionPool with new connections.

    Returns

    Parameters

    • connections: any[]

    Returns BaseConnectionPool

  • Transforms an url string to a host object

    Returns

    host

    Parameters

    • url: string

    Returns { url: URL }

    • url: URL

Generated using TypeDoc