Skip to main content
Worker.prototype.once - node__cluster.d.ts - Node documentation
method Worker.prototype.once

Usage in Deno

```typescript import { Worker } from "node:node__cluster.d.ts"; ```
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