Skip to content

This site describes solve-engine 2.44.0, the version npm installs.

messagePortTransport

function messagePortTransport(port): WorkerTransport;

Defined in: packages/engine/src/worker/transport.ts:171

Adapt a Node worker_threads port onto a WorkerTransport.

Covers the main-side Worker, the worker’s parentPort, and a worker_threads MessagePort: each posts with postMessage and emits a "message" event whose argument IS the payload (no .data wrapper, unlike the DOM). On the main side pass the Worker; inside the worker pass parentPort.

ParameterType
portMessagePortLike

WorkerTransport