Options
All
  • Public
  • Public/Protected
  • All
Menu

RedisPool

Hierarchy

  • default

Index

Constructors

constructor

  • new default(__namedParameters: { logger?: undefined | Logger; name?: undefined | string; poolOptions?: undefined | Options; redisOptions: ClientOpts }): default
  • Parameters

    • __namedParameters: { logger?: undefined | Logger; name?: undefined | string; poolOptions?: undefined | Options; redisOptions: ClientOpts }
      • Optional logger?: undefined | Logger
      • Optional name?: undefined | string
      • Optional poolOptions?: undefined | Options
      • redisOptions: ClientOpts

    Returns default

Properties

logger

logger: { debug: Function; error: Function; info: Function; log: Function; warn: Function }

Type declaration

  • debug: Function
  • error: Function
  • info: Function
  • log: Function
  • warn: Function

name

name: string

pool

pool: Pool<any>

poolOptions

poolOptions: Options

redisOptions

redisOptions: ClientOpts

Methods

acquire

  • acquire(priority?: number, db?: number): Promise<RedisClient>
  • Acquire a Redis connection and use an optional priority.

    async

    Parameters

    • Optional priority: number

      priority list number

    • Optional db: number

    Returns Promise<RedisClient>

    Promise resolve with the connection or Error

availableCount

  • availableCount(): number
  • Returns available connections count of the pool

    Returns number

    available connections count of the pool

destroy

  • destroy(client?: RedisClient): Promise<void>
  • Destroy a Redis connection.

    async

    Parameters

    • Optional client: RedisClient

      Redis connection

    Returns Promise<void>

    void

drain

  • drain(): Promise<void>
  • Drains the connection pool and call the callback id provided.

    async

    Returns Promise<void>

    Promise

getName

  • getName(): string

getPoolOptions

  • getPoolOptions(): Options

getPoolSize

  • getPoolSize(): number

getRedisOptions

  • getRedisOptions(): ClientOpts

pendingCount

  • pendingCount(): number
  • Returns pending connections count of the pool

    Returns number

    pending connections count of the pool

release

  • release(client?: RedisClient): Promise<void>
  • Release a Redis connection to the pool.

    async

    Parameters

    • Optional client: RedisClient

      Redis connection

    Returns Promise<void>

    void

sendCommand

  • sendCommand(commandName: string, commandArgs?: any[]): Promise<any>
  • Send redis instructions

    async

    Parameters

    • commandName: string

      Name of the command

    • commandArgs: any[] = ...

      Args sent to the command

    Returns Promise<any>

    Promise resolve with the result or Error

status

Legend

  • Constructor
  • Property
  • Method
  • Property

Generated using TypeDoc