Skip to main content
Worker.prototype.on - cluster - Node documentation
method Worker.prototype.on

Usage in Deno

import { Worker } from "node:cluster";
Worker.prototype.on(
event: string,
listener: (...args: any[]) => void,
): this

Parameters

event: string
listener: (...args: any[]) => void

Return Type

this
Worker.prototype.on(
event: "disconnect",
listener: () => void,
): this

Parameters

event: "disconnect"
listener: () => void

Return Type

this
Worker.prototype.on(
event: "error",
listener: (error: Error) => void,
): this

Parameters

event: "error"
listener: (error: Error) => void

Return Type

this
Worker.prototype.on(
event: "exit",
listener: (
code: number,
signal: string,
) => void
,
): this

Parameters

event: "exit"
listener: (
code: number,
signal: string,
) => void

Return Type

this
Worker.prototype.on(
event: "listening",
listener: (address: Address) => void,
): this

Parameters

event: "listening"
listener: (address: Address) => void

Return Type

this
Worker.prototype.on(
event: "message",
listener: (
message: any,
handle: net.Socket | net.Server,
) => void
,
): this

Parameters

event: "message"
listener: (
message: any,
handle: net.Socket | net.Server,
) => void

Return Type

this
Worker.prototype.on(
event: "online",
listener: () => void,
): this

Parameters

event: "online"
listener: () => void

Return Type

this