MessagePort
One end of a two-way message channel created with MessageChannel, which can be transferred so two contexts talk directly.
In more detail
Each MessageChannel has two ports, one for each side. Transferring a port to a worker gives it a private line to another context without routing messages through the page.
Related terms
- postMessage() — The method used to send data between a page and a worker, or between windows, delivered as a message event on the other side.
- transferable object — An object, such as an ArrayBuffer, ImageBitmap or MessagePort, whose memory can be moved to another thread instead of copied.
Taught in
- Web Workers: Off-Thread Computation And Structured Clone — Frontend Architecture & Web Platform