import { type MessagePort } from "https://deno.land/x/deno@v1.41.0/ext/web/lib.deno_web.d.ts";
The MessagePort interface of the Channel Messaging API represents one of the two ports of a MessageChannel, allowing messages to be sent from one port and listening out for them arriving at the other.
Properties
Methods
Posts a message through the channel. Objects listed in transfer are transferred, not just cloned, meaning that they are no longer usable on the sending side.
Throws a "DataCloneError" DOMException if transfer contains duplicate objects or port, or if message could not be cloned.
Begins dispatching messages received on the port. This is implicitly called
when assigning a value to this.onmessage
.
import { MessagePort } from "https://deno.land/x/deno@v1.41.0/ext/web/lib.deno_web.d.ts";
The MessagePort interface of the Channel Messaging API represents one of the two ports of a MessageChannel, allowing messages to be sent from one port and listening out for them arriving at the other.