interface Cluster
implements EventEmitter
import { type Cluster } from "https://deno.land/std@0.172.0/node/internal/cluster/types.ts";
Properties
readonly
settings: ClusterSettingsreadonly
optional
worker: Worker | nullreadonly
optional
Worker: WorkerClassreadonly
optional
workers: Record<number, Worker>Methods
fork(env?: Record<string | number, unknown>): Worker
deprecated
setupMaster(settings?: ClusterSettings): voidsetupPrimary(settings?: ClusterSettings): void
setupPrimary
is used to change the default 'fork' behavior. Once called, the settings will be present in cluster.settings.
events.EventEmitter
- disconnect
- exit
- fork
- listening
- message
- online
- setup
addListener(event: "disconnect", listener: (worker: Worker) => void): this
addListener(event: "fork", listener: (worker: Worker) => void): this
addListener(event: "online", listener: (worker: Worker) => void): this
addListener(event: "setup", listener: (settings: ClusterSettings) => void): this
emit(event: "disconnect", worker: Worker): boolean
emit(event: "fork", worker: Worker): boolean
emit(event: "online", worker: Worker): boolean
emit(event: "setup", settings: ClusterSettings): boolean
on(event: "disconnect", listener: (worker: Worker) => void): this
on(event: "fork", listener: (worker: Worker) => void): this
on(event: "online", listener: (worker: Worker) => void): this
on(event: "setup", listener: (settings: ClusterSettings) => void): this
once(event: "disconnect", listener: (worker: Worker) => void): this
once(event: "fork", listener: (worker: Worker) => void): this
once(event: "online", listener: (worker: Worker) => void): this
once(event: "setup", listener: (settings: ClusterSettings) => void): this
prependListener(event: "disconnect", listener: (worker: Worker) => void): this
prependListener(event: "fork", listener: (worker: Worker) => void): this
prependListener(event: "online", listener: (worker: Worker) => void): this
prependListener(event: "setup", listener: (settings: ClusterSettings) => void): this
prependOnceListener(event: "disconnect", listener: (worker: Worker) => void): this
prependOnceListener(event: "fork", listener: (worker: Worker) => void): this
prependOnceListener(event: "online", listener: (worker: Worker) => void): this
prependOnceListener(event: "setup", listener: (settings: ClusterSettings) => void): this