Skip to main content
Cluster.once - cluster - Node documentation
method Cluster.once

Usage in Deno

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

Parameters

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

Return Type

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

Parameters

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

Return Type

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

Parameters

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

Return Type

this
Cluster.once(
event: "fork",
listener: (worker: Worker) => void,
): this

Parameters

event: "fork"
listener: (worker: Worker) => void

Return Type

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

Parameters

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

Return Type

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

Parameters

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

Return Type

this
Cluster.once(
event: "online",
listener: (worker: Worker) => void,
): this

Parameters

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

Return Type

this
Cluster.once(
event: "setup",
listener: (settings: ClusterSettings) => void,
): this

Parameters

event: "setup"
listener: (settings: ClusterSettings) => void

Return Type

this