6de2455917
- Added GLOBAL_MARKETS_TITLE to all translation files - Updated footer with 12 markets (4 active + 8 upcoming) - Translated market section to: zh-cn, zh-tw, ja, ko, th, vi, id, ms, hi - Built and deployed to production - CloudFront invalidation: I3RTMXVFDJXWLG3SYX208OP1CC
40 lines
1.3 KiB
TypeScript
40 lines
1.3 KiB
TypeScript
/// <reference types="node" />
|
|
import { EventEmitter } from "events";
|
|
import { RedisOptions, NodeKey, NodeRole } from "./util";
|
|
import { ClusterOptions, ClusterNodeRetryStrategy } from "./ClusterOptions";
|
|
import Redis from "../Redis";
|
|
export default class ConnectionPool extends EventEmitter {
|
|
private redisOptions;
|
|
private clusterNodeRetryStrategy;
|
|
private nodes;
|
|
private specifiedOptions;
|
|
constructor(redisOptions: NonNullable<ClusterOptions["redisOptions"]>, clusterNodeRetryStrategy?: ClusterNodeRetryStrategy);
|
|
getNodes(role?: NodeRole): Redis[];
|
|
getInstanceByKey(key: NodeKey): Redis;
|
|
getSampleInstance(role: NodeRole): Redis;
|
|
/**
|
|
* Add a master node to the pool
|
|
* @param node
|
|
*/
|
|
addMasterNode(node: RedisOptions): boolean;
|
|
/**
|
|
* Creates a Redis connection instance from the node options
|
|
* @param node
|
|
* @param readOnly
|
|
*/
|
|
createRedisFromOptions(node: RedisOptions, readOnly: boolean): Redis;
|
|
/**
|
|
* Find or create a connection to the node
|
|
*/
|
|
findOrCreate(node: RedisOptions, readOnly?: boolean): Redis;
|
|
/**
|
|
* Reset the pool with a set of nodes.
|
|
* The old node will be removed.
|
|
*/
|
|
reset(nodes: RedisOptions[]): void;
|
|
/**
|
|
* Remove a node from the pool.
|
|
*/
|
|
private removeNode;
|
|
}
|