MessagePort.prototype.on - Node documentation
method MessagePort.prototype.on

Usage in Deno

import { MessagePort } from "node:worker_threads";
MessagePort.prototype.on(
event: "close",
listener: () => void,
): this

Parameters

event: "close"
listener: () => void

Return Type

this
MessagePort.prototype.on(
event: "message",
listener: (value: any) => void,
): this

Parameters

event: "message"
listener: (value: any) => void

Return Type

this
MessagePort.prototype.on(
event: "messageerror",
listener: (error: Error) => void,
): this

Parameters

event: "messageerror"
listener: (error: Error) => void

Return Type

this
MessagePort.prototype.on(
event: string | symbol,
listener: (...args: any[]) => void,
): this

Parameters

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

Return Type

this