Cluster.addListener - Node documentation
method Cluster.addListener

Usage in Deno

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

events.EventEmitter

  1. disconnect
  2. exit
  3. fork
  4. listening
  5. message
  6. online
  7. setup

Parameters

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

Return Type

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

Parameters

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

Return Type

this
Cluster.addListener(
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.addListener(
event: "fork",
listener: (worker: Worker) => void,
): this

Parameters

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

Return Type

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

Parameters

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

Return Type

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

Parameters

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

Return Type

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

Parameters

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

Return Type

this