Worker.prototype.emit - Node documentation
method Worker.prototype.emit

Usage in Deno

import { Worker } from "node:worker_threads";
Worker.prototype.emit(
event: "error",
err: Error,
): boolean

Parameters

event: "error"
err: Error

Return Type

boolean
Worker.prototype.emit(
event: "exit",
exitCode: number,
): boolean

Parameters

event: "exit"
exitCode: number

Return Type

boolean
Worker.prototype.emit(
event: "message",
value: any,
): boolean

Parameters

event: "message"
value: any

Return Type

boolean
Worker.prototype.emit(
event: "messageerror",
error: Error,
): boolean

Parameters

event: "messageerror"
error: Error

Return Type

boolean
Worker.prototype.emit(event: "online"): boolean

Parameters

event: "online"

Return Type

boolean
Worker.prototype.emit(
event: string | symbol,
...args: any[],
): boolean

Parameters

event: string | symbol
...args: any[]

Return Type

boolean