UNPKG

discord-hybrid-sharding

Version:

The first package which combines sharding manager & internal sharding to save a lot of resources, which allows clustering!

41 lines 1.31 kB
import { messageType } from '../types/shared'; import { ClusterClient } from '../Core/ClusterClient'; import { Cluster } from '../Core/Cluster'; export interface RawMessage { nonce?: string; _type?: number | messageType; [x: string]: any; } export declare class BaseMessage { [x: string]: any; nonce: string; private readonly _raw; constructor(message: RawMessage); /** * Destructs the Message Object and initializes it on the Constructor */ private destructMessage; toJSON(): RawMessage; } export declare class IPCMessage extends BaseMessage { raw: RawMessage; instance: ClusterClient<any> | Cluster; constructor(instance: ClusterClient<any> | Cluster, message: RawMessage); /** * Sends a message to the cluster's process/worker or to the ParentCluster. */ send(message: object): Promise<unknown>; /** * Sends a Request to the cluster's process/worker or to the ParentCluster. */ request(message: object): Promise<unknown>; /** * Sends a Reply to Message from the cluster's process/worker or the ParentCluster. */ reply(message: object): Promise<unknown>; /** * Gets the type of the Message from the raw properties */ getType(): number; } //# sourceMappingURL=IPCMessage.d.ts.map