Offload functions to worker threads with shared memory primitives for Node.js.
8
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix: type Task.worker and StreamTask.worker as WorkerHandle

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

+4 -2
+2 -1
src/stream-task.ts
··· 1 1 import { runStreamOnDedicated } from './dedicated-runner.ts'; 2 + import type { WorkerHandle } from './runner.ts'; 2 3 3 4 let nextUid = 0; 4 5 ··· 11 12 readonly uid: number; 12 13 readonly id: string; 13 14 readonly args: unknown[]; 14 - worker?: unknown; 15 + worker?: WorkerHandle; 15 16 16 17 /** @param id - The moroutine identifier (module URL + index). 17 18 * @param args - The arguments to pass to the worker generator function. */
+2 -1
src/task.ts
··· 1 1 import { runOnDedicated } from './dedicated-runner.ts'; 2 + import type { WorkerHandle } from './runner.ts'; 2 3 3 4 let nextUid = 0; 4 5 ··· 10 11 readonly uid: number; 11 12 readonly id: string; 12 13 readonly args: unknown[]; 13 - worker?: unknown; 14 + worker?: WorkerHandle; 14 15 15 16 /** @param id - The moroutine identifier (module URL + index). 16 17 * @param args - The arguments to pass to the worker function. */