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

Usage in Deno

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

Parameters

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

Return Type

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

Parameters

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

Return Type

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

Parameters

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

Return Type

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

Parameters

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

Return Type

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

Parameters

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

Return Type

this
Worker.prototype.once(
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.once(
event: "online",
listener: () => void,
): this

Parameters

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

Return Type

this
Back to top