Options
All
  • Public
  • Public/Protected
  • All
Menu

Class RedisOptions

Redis Client Configuration options.

Hierarchy

  • RedisOptions

Index

Constructors

constructor

  • Returns RedisOptions

  • Parameters

    Returns RedisOptions

Methods

addConnectionString

  • addConnectionString(connectionStrings: string): RedisOptions
  • Adds a connection string (endpoint) to use while connecting to the redis server. Only the cluster mode will consider more than 1 element. If more are provided, they are not considered by the client when in single server mode.

    Parameters

    • connectionStrings: string

    Returns RedisOptions

addEndpoint

  • Set the endpoints to use while connecting to the redis server. Only the cluster mode will consider more than 1 element. If more are provided, they are not considered by the client when in single server mode.

    Parameters

    • endpoints: string

    Returns RedisOptions

getEndpoint

  • getEndpoint(): string
  • Sets a single connection string to use while connecting to the redis server. Will replace the previously configured connection strings.

    Returns string

getEndpoints

  • getEndpoints(): string
  • Set the endpoints to use while connecting to the redis server. Only the cluster mode will consider more than 1 element. If more are provided, they are not considered by the client when in single server mode.

    Returns string

getMasterName

  • getMasterName(): string
  • Set the master name (only considered in HA mode).

    Returns string

getMaxNestedArrays

  • getMaxNestedArrays(): number
  • Tune how much nested arrays are allowed on a redis response. This affects the parser performance.

    Returns number

getMaxPoolSize

  • getMaxPoolSize(): number
  • Tune the maximum size of the connection pool. When working with cluster or sentinel this value should be atleast the total number of cluster member (or number of sentinels + 1)

    Returns number

getMaxPoolWaiting

  • getMaxPoolWaiting(): number
  • Tune the maximum waiting requests for a connection from the pool.

    Returns number

getMaxWaitingHandlers

  • getMaxWaitingHandlers(): number
  • The client will always work on pipeline mode, this means that messages can start queueing. You can control how much backlog you're willing to accept. This methods sets how much handlers is the client willing to queue.

    Returns number

getNetClientOptions

  • getNetClientOptions(): NetClientOptions
  • Set the net client options to be used while connecting to the redis server. Use this to tune your connection.

    Returns NetClientOptions

getPassword

  • getPassword(): string
  • Set the default password for cluster/sentinel connections.

    Returns string

getPoolCleanerInterval

  • getPoolCleanerInterval(): number
  • Tune how often in milliseconds should the connection pool cleaner execute.

    Returns number

getPoolRecycleTimeout

  • getPoolRecycleTimeout(): number
  • Tune when a connection should be recycled in milliseconds.

    Returns number

getRole

  • Set the role name (only considered in HA mode).

    Returns RedisRole

getType

  • Set the desired client type to be created.

    Returns RedisClientType

getUseReplicas

  • Set whether or not to use replica nodes (only considered in Cluster mode).

    Returns RedisReplicas

setConnectionString

  • setConnectionString(connectionString: string): RedisOptions
  • Sets a single connection string (endpoint) to use while connecting to the redis server. Will replace the previously configured connection strings.

    Parameters

    • connectionString: string

    Returns RedisOptions

setEndpoint

  • Sets a single connection string to use while connecting to the redis server. Will replace the previously configured connection strings.

    Parameters

    • endpoint: string

    Returns RedisOptions

setEndpoints

  • Set the endpoints to use while connecting to the redis server. Only the cluster mode will consider more than 1 element. If more are provided, they are not considered by the client when in single server mode.

    Parameters

    • endpoints: string

    Returns RedisOptions

setMasterName

  • Set the master name (only considered in HA mode).

    Parameters

    • masterName: string

    Returns RedisOptions

setMaxNestedArrays

  • Tune how much nested arrays are allowed on a redis response. This affects the parser performance.

    Parameters

    • maxNestedArrays: number

    Returns RedisOptions

setMaxPoolSize

  • Tune the maximum size of the connection pool. When working with cluster or sentinel this value should be atleast the total number of cluster member (or number of sentinels + 1)

    Parameters

    • maxPoolSize: number

    Returns RedisOptions

setMaxPoolWaiting

  • Tune the maximum waiting requests for a connection from the pool.

    Parameters

    • maxPoolWaiting: number

    Returns RedisOptions

setMaxWaitingHandlers

  • setMaxWaitingHandlers(maxWaitingHandlers: number): RedisOptions
  • The client will always work on pipeline mode, this means that messages can start queueing. You can control how much backlog you're willing to accept. This methods sets how much handlers is the client willing to queue.

    Parameters

    • maxWaitingHandlers: number

    Returns RedisOptions

setNetClientOptions

  • setNetClientOptions(netClientOptions: NetClientOptions): RedisOptions
  • Set the net client options to be used while connecting to the redis server. Use this to tune your connection.

    Parameters

    • netClientOptions: NetClientOptions

    Returns RedisOptions

setPassword

  • Set the default password for cluster/sentinel connections.

    Parameters

    • password: string

    Returns RedisOptions

setPoolCleanerInterval

  • setPoolCleanerInterval(poolCleanerInterval: number): RedisOptions
  • Tune how often in milliseconds should the connection pool cleaner execute.

    Parameters

    • poolCleanerInterval: number

    Returns RedisOptions

setPoolRecycleTimeout

  • setPoolRecycleTimeout(poolRecycleTimeout: number): RedisOptions
  • Tune when a connection should be recycled in milliseconds.

    Parameters

    • poolRecycleTimeout: number

    Returns RedisOptions

setRole

  • Set the role name (only considered in HA mode).

    Parameters

    Returns RedisOptions

setType

  • Set the desired client type to be created.

    Parameters

    Returns RedisOptions

setUseReplicas

  • Set whether or not to use replica nodes (only considered in Cluster mode).

    Parameters

    Returns RedisOptions

Generated using TypeDoc