Skip to main content
Module

x/rimbu/channel/mod.ts>RemoteChannel.SimpleMessagePort

Rimbu is a TypeScript library focused on immutable, performant, and type-safe collections and other tools.
Go to Latest
interface RemoteChannel.SimpleMessagePort
import { type RemoteChannel } from "https://deno.land/x/rimbu@1.0.2/channel/mod.ts";
const { SimpleMessagePort } = RemoteChannel;

Interface used to perform low-level message communication between processes. Compatible with browser, Node, and Worker contexts.

Methods

postMessage(message: any): void

Sends a message to the message port.

addEventListener(
type: "message",
listener: (ev: { data: any; }) => any,
options?: boolean | { once?: boolean; },
): void

Adds a message listener to the message port.

removeEventListener(type: "message", listener: (ev: { data: any; }) => any): void

Removes a message listener from the message port.