UNPKG

redis-smq-common

Version:

Provides essential components and utilities shared across RedisSMQ packages.

23 lines 997 B
import { ICallback } from '../../async/index.js'; export interface IHeartbeatPayload<T = unknown> { timestamp: number; componentId: string; componentType: string; data: T; } export interface IHeartbeatConfig { componentId: string; componentType: string; heartbeatKey: string; heartbeatTTL?: number; } export type THeartbeatDataFn<T> = (cb: ICallback<T>) => void; export type THeartbeatEvent<T> = { 'heartbeat.beat': (componentId: string, componentType: string, timestamp: number, payload: IHeartbeatPayload<T>) => void; 'heartbeat.error': (err: Error, componentId: string, componentType: string) => void; 'heartbeat.goingDown': (componentId: string, componentType: string) => void; 'heartbeat.down': (componentId: string, componentType: string) => void; 'heartbeat.goingUp': (componentId: string, componentType: string) => void; 'heartbeat.up': (componentId: string, componentType: string) => void; }; //# sourceMappingURL=heartbeat.d.ts.map