interface RemoteChannel.SimpleMessagePort
Interface used to perform low-level message communication between processes. Compatible with browser, Node, and Worker contexts.
Methods
addEventListener
Adds a message listener to the message port.
addEventListenerDefinition
addEventListener(type: 'message', listener: (ev: {
data: any;
}) => any, options?: boolean | {
once?: boolean;
}): void;
Parameters
| Name | Type | Description |
|---|---|---|
type | 'message' | only 'message' is supported. |
listener | (ev: {data: any;}) => any | a callback function receiving the message data |
options | boolean | {once?: boolean;} | (optional) callback options |
postMessage
Sends a message to the message port.
postMessageremoveEventListener
Removes a message listener from the message port.
removeEventListener