Skip to content

This site describes solve-engine as it is on main: 2.43.0, which npm does not have yet. npm installs 2.40.0, so a page may show an answer that version does not give yet.

WorkerTransport

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

A bidirectional message channel with a single receive handler.

onMessage registers the one handler the harness needs; calling it again replaces the previous handler. terminate tears the channel down and is safe to call more than once.

onMessage(handler): void;

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

Register the handler that receives messages from the other end.

ParameterType
handler(message) => void

void


postMessage(message): void;

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

Send one message to the other end. The message must be clone-safe.

ParameterType
messageunknown

void


terminate(): void;

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

Tear the channel down. Idempotent.

void