Interface IWorker

Worker interface.

interface IWorker {
    disconnect?: (() => void);
    id?: number;
    kill?: ((signal?) => void);
    on: ((event, handler) => void);
    once: ((event, handler) => void);
    terminate?: (() => Promise<number>);
    threadId?: number;
}

Properties

disconnect?: (() => void)

Type declaration

    • (): void
    • Cluster worker disconnect.

      Returns void

id?: number

Cluster worker id.

kill?: ((signal?) => void)

Type declaration

    • (signal?): void
    • Cluster worker kill.

      Parameters

      • Optional signal: string

      Returns void

on: ((event, handler) => void)

Type declaration

once: ((event, handler) => void)

Type declaration

terminate?: (() => Promise<number>)

Type declaration

    • (): Promise<number>
    • Stop all JavaScript execution in the worker thread as soon as possible. Returns a Promise for the exit code that is fulfilled when the 'exit' event is emitted.

      Returns Promise<number>

threadId?: number

Worker thread worker id.

Generated using TypeDoc