Skip to content

WorkerNode

const WorkerNode: object

Defined in: src/worker/WorkerNode.ts:37

Worker-side helper. Call await WorkerNode.join() from inside an async function (async function main() { … } main();), NOT as a top-level await. In Bun, top-level await inside a worker suspends the module loader in a way that prevents incoming messages from dispatching to self.onmessage, and the handshake hangs forever.

join<TInit>(): Promise<WorkerNodeContext<TInit>>

TInit = unknown

Promise<WorkerNodeContext<TInit>>