@types/cluster-hub
TypeScript icon, indicating that this package has built-in type declarations

0.1.5 • Public • Published

Installation

npm install --save @types/cluster-hub

Summary

This package contains type definitions for cluster-hub (https://github.com/sirian/node-cluster-hub#readme).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/cluster-hub.

index.d.ts

/// <reference types="node" />

import { Worker } from "cluster";
import { EventEmitter } from "events";

export = Hub;

declare class Hub extends EventEmitter {
    constructor(messageKey?: string);
    sendToMaster(type: string | symbol, data?: any): boolean;
    sendToWorker(worker: Worker, type: string | symbol, data?: any): boolean;
    sendToRandomWorker(type: string | symbol, data?: any): boolean;
    sendToWorkers(type: string | symbol, data?: any): boolean;
    requestMaster(type: string | symbol, data?: any, callback?: Hub.Callback): boolean;
    requestWorker(worker: Worker, type: string | symbol, data?: any, callback?: Hub.Callback): boolean;
    requestAllWorkers(type: string | symbol, data?: any, callback?: Hub.Callback): boolean;
    requestRandomWorker(type: string | symbol, data?: any, callback?: Hub.Callback): boolean;
    lock(lockKey: string, callback?: (unlock: () => void) => void): boolean;
}

declare namespace Hub {
    type Callback = (err: Error | null, response: any) => void;
}

Additional Details

  • Last updated: Mon, 06 Nov 2023 22:41:05 GMT
  • Dependencies: @types/node

Credits

These definitions were written by Chun-Kai Wang.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/cluster-hub

Weekly Downloads

27

Version

0.1.5

License

MIT

Unpacked Size

4.69 kB

Total Files

5

Last publish

Collaborators

  • types