UNPKG

1.27 kBTypeScriptView Raw
1import { Transport } from '../enums';
2import { CustomTransportStrategy, RedisOptions } from '../interfaces';
3import { Server } from './server';
4declare type Redis = any;
5export declare class ServerRedis extends Server implements CustomTransportStrategy {
6 private readonly options;
7 readonly transportId = Transport.REDIS;
8 private subClient;
9 private pubClient;
10 private isExplicitlyTerminated;
11 constructor(options: RedisOptions['options']);
12 listen(callback: (err?: unknown, ...optionalParams: unknown[]) => void): void;
13 start(callback?: () => void): void;
14 bindEvents(subClient: Redis, pubClient: Redis): void;
15 close(): void;
16 createRedisClient(): Redis;
17 getMessageHandler(pub: Redis): (channel: string, buffer: string | any) => Promise<any>;
18 handleMessage(channel: string, buffer: string | any, pub: Redis): Promise<any>;
19 getPublisher(pub: Redis, pattern: any, id: string): (response: any) => any;
20 parseMessage(content: any): Record<string, any>;
21 getRequestPattern(pattern: string): string;
22 getReplyPattern(pattern: string): string;
23 handleError(stream: any): void;
24 getClientOptions(): Partial<RedisOptions['options']>;
25 createRetryStrategy(times: number): undefined | number | void;
26}
27export {};