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.
24 lines (23 loc) • 1.28 kB
TypeScript
import { BaseMessage, DataType } from '../other/message';
import { ClientRefType, ClusterClient } from '../core/clusterClient';
import { Serializable } from '../types';
import { Worker } from '../classes/worker';
import { Cluster } from '../core/cluster';
import { Child } from '../classes/child';
/** Handles messages for the cluster. */
export declare class ClusterHandler {
private cluster;
private ipc;
/** Creates an instance of ClusterHandler. */
constructor(cluster: Cluster, ipc: Worker | Child);
/** Handles the message received, and executes the callback. (Not meant to be used by the user.) */
handleMessage<D extends DataType, A = Serializable, P extends object = object>(message: BaseMessage<D, A, P>): Promise<void>;
}
/** Handles messages for the cluster client. */
export declare class ClusterClientHandler<InternalClient extends ClientRefType = ClientRefType> {
private clusterClient;
/** Creates an instance of ClusterClientHandler. */
constructor(clusterClient: ClusterClient<InternalClient>);
/** Handles the message received, and executes the callback. (Not meant to be used by the user.) */
handleMessage<D extends DataType, A = Serializable, P extends object = object>(message: BaseMessage<D, A, P>): Promise<void>;
}