syntropylog
Version:
An instance manager with observability for Node.js applications
29 lines (28 loc) • 1.07 kB
TypeScript
/**
* @file src/redis/RedisManager.ts
* @description Manages the lifecycle of multiple instrumented Redis client instances.
*/
import { IContextManager } from '../context';
import { ILogger } from '../logger';
import { SyntropyRedisConfig } from '../config';
import { IBeaconRedis } from './IBeaconRedis';
/**
* Manages the creation, retrieval, and lifecycle of multiple `IBeaconRedis` instances
* based on the provided configuration. It acts as a central point of access for all
* Redis clients within an application.
*/
export declare class RedisManager {
private readonly instances;
private defaultInstance?;
private readonly logger;
private readonly config;
private readonly contextManager;
constructor(config: SyntropyRedisConfig, logger: ILogger, contextManager: IContextManager);
init(): void;
getInstance(name?: string): IBeaconRedis;
/**
* Gracefully shuts down all managed Redis connections.
* It attempts to close all connections and waits for them to complete.
*/
shutdown(): Promise<void>;
}