UNPKG

status-sharding

Version:

Welcome to Status Sharding! This package is designed to provide an efficient and flexible solution for sharding Discord bots, allowing you to scale your bot across multiple processes or workers.

31 lines (30 loc) 1.08 kB
import { ClusterManager } from '../core/clusterManager'; import { HeartbeatData } from '../types'; /** Handles heartbeats for the cluster manager. */ export declare class HeartbeatManager { private readonly manager; /** The interval of the heartbeat. */ private readonly interval; /** The list of heartbeat data per cluster. */ private readonly beats; /** Creates an instance of HeartbeatManager. */ constructor(manager: ClusterManager); /** Stops the heartbeat. */ stop(): void; /** Gets the heartbeat data for a cluster. */ getClusterStats(id: number): HeartbeatData; /** Removes a cluster from the heartbeat. */ removeCluster(id: number): void; /** Adds a missed beat to a cluster. */ private addMissedBeat; /** Check if cluster process/thread is actually aliv.e */ private isClusterProcessAlive; /** Handle detected crash */ private handleCrashedCluster; getHealthSummary(): { clusterId: number; status: string; missedBeats: number; restarts: number; }[]; }