helene
Version:
Real-time Web Apps for Node.js
30 lines (29 loc) • 809 B
TypeScript
import { RedisClientOptions } from 'redis';
import { Server } from '../server';
export type RedisMessage = {
event: string;
channel: string;
message: string;
};
export declare const RedisKey: {
CLIENTS: string;
};
/**
* This is mainly used to propagate events to other instances when running node in a cluster.
*/
export declare class RedisTransport {
opts: RedisClientOptions;
pub: any;
sub: any;
server: Server;
static defaultRedisOpts: RedisClientOptions;
constructor(server: Server, opts: RedisClientOptions | boolean);
private connect;
publish(event: string, channel: string, message: string): Promise<any>;
close(): Promise<void>;
getStats(): Promise<{
clientCount: number;
userCount: number;
users: unknown[];
}>;
}