Options
All
  • Public
  • Public/Protected
  • All
Menu

Class PoolOptions

The options for configuring a connection pool.

Hierarchy

  • PoolOptions

Index

Constructors

constructor

  • Returns PoolOptions

  • Parameters

    Returns PoolOptions

Methods

getConnectionTimeout

  • getConnectionTimeout(): number
  • Set the amount of time a client will wait for a connection from the pool. If the time is exceeded without a connection available, an exception is provided.

    Returns number

getConnectionTimeoutUnit

  • getConnectionTimeoutUnit(): any
  • Set the time unit of PoolOptions

    Returns any

getEventLoopSize

  • getEventLoopSize(): number
  • Set the number of event-loop the pool use.

    • when the size is 0, the client pool will use the current event-loop
    • otherwise the client will create and use its own event loop

    The default size is 0.

    Returns number

getIdleTimeout

  • getIdleTimeout(): number
  • Establish an idle timeout for pooled connections, a value of zero disables the idle timeout.

    Returns number

getIdleTimeoutUnit

  • getIdleTimeoutUnit(): any
  • Establish an idle timeout unit for pooled connections.

    Returns any

getMaxLifetime

  • getMaxLifetime(): number
  • Establish a max lifetime for pooled connections, a value of zero disables the maximum lifetime.

    Returns number

getMaxLifetimeUnit

  • getMaxLifetimeUnit(): any
  • Establish a max lifetime unit for pooled connections.

    Returns any

getMaxSize

  • getMaxSize(): number
  • Set the maximum pool size

    Returns number

getMaxWaitQueueSize

  • getMaxWaitQueueSize(): number
  • Set the maximum connection request allowed in the wait queue, any requests beyond the max size will result in an failure. If the value is set to a negative number then the queue will be unbounded.

    Returns number

getName

  • getName(): string
  • Set the pool name, used when the pool shared, otherwise ignored.

    Returns string

getPoolCleanerPeriod

  • getPoolCleanerPeriod(): number
  • Set the connection pool cleaner period in milli seconds, a non positive value disables expiration checks and connections will remain in the pool until they are closed.

    Returns number

isShared

  • isShared(): boolean
  • Set to true to share the pool.

    There can be multiple shared pools distinguished by PoolOptions, when no specific name is set, the PoolOptions is used.

    Returns boolean

setConnectionTimeout

  • setConnectionTimeout(connectionTimeout: number): PoolOptions
  • Set the amount of time a client will wait for a connection from the pool. If the time is exceeded without a connection available, an exception is provided.

    Parameters

    • connectionTimeout: number

    Returns PoolOptions

setConnectionTimeoutUnit

  • setConnectionTimeoutUnit(connectionTimeoutUnit: any): PoolOptions
  • Set the time unit of PoolOptions

    Parameters

    • connectionTimeoutUnit: any

    Returns PoolOptions

setEventLoopSize

  • Set the number of event-loop the pool use.

    • when the size is 0, the client pool will use the current event-loop
    • otherwise the client will create and use its own event loop

    The default size is 0.

    Parameters

    • eventLoopSize: number

    Returns PoolOptions

setIdleTimeout

  • Establish an idle timeout for pooled connections, a value of zero disables the idle timeout.

    Parameters

    • idleTimeout: number

    Returns PoolOptions

setIdleTimeoutUnit

  • setIdleTimeoutUnit(idleTimeoutUnit: any): PoolOptions
  • Establish an idle timeout unit for pooled connections.

    Parameters

    • idleTimeoutUnit: any

    Returns PoolOptions

setMaxLifetime

  • Establish a max lifetime for pooled connections, a value of zero disables the maximum lifetime.

    Parameters

    • maxLifetime: number

    Returns PoolOptions

setMaxLifetimeUnit

  • setMaxLifetimeUnit(maxLifetimeUnit: any): PoolOptions
  • Establish a max lifetime unit for pooled connections.

    Parameters

    • maxLifetimeUnit: any

    Returns PoolOptions

setMaxSize

  • Set the maximum pool size

    Parameters

    • maxSize: number

    Returns PoolOptions

setMaxWaitQueueSize

  • setMaxWaitQueueSize(maxWaitQueueSize: number): PoolOptions
  • Set the maximum connection request allowed in the wait queue, any requests beyond the max size will result in an failure. If the value is set to a negative number then the queue will be unbounded.

    Parameters

    • maxWaitQueueSize: number

    Returns PoolOptions

setName

  • Set the pool name, used when the pool shared, otherwise ignored.

    Parameters

    • name: string

    Returns PoolOptions

setPoolCleanerPeriod

  • setPoolCleanerPeriod(poolCleanerPeriod: number): PoolOptions
  • Set the connection pool cleaner period in milli seconds, a non positive value disables expiration checks and connections will remain in the pool until they are closed.

    Parameters

    • poolCleanerPeriod: number

    Returns PoolOptions

setShared

  • Set to true to share the pool.

    There can be multiple shared pools distinguished by PoolOptions, when no specific name is set, the PoolOptions is used.

    Parameters

    • shared: boolean

    Returns PoolOptions

toJson

  • toJson(): {}
  • Returns {}

    • [key: string]: any

Generated using TypeDoc