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.

chore: update examples to use new descriptor API

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

+5 -5
+2 -2
examples/atomics/increment.ts
··· 1 - import { mo } from "../../src/index.ts"; 2 - import { AtomicInt32 } from "../../src/index.ts"; 1 + import { mo } from '../../src/index.ts'; 2 + import type { AtomicInt32 } from '../../src/index.ts'; 3 3 4 4 export const increment = mo(import.meta, (counter: AtomicInt32): number => { 5 5 return counter.add(1);
+3 -3
examples/atomics/main.ts
··· 1 - // Shared memory between main thread and workers using AtomicInt32. 1 + // Shared memory between main thread and workers using int32atomic. 2 2 // 3 3 // Run: node --experimental-strip-types examples/atomics/main.ts 4 4 5 - import { workerPool, AtomicInt32 } from '../../src/index.ts'; 5 + import { workerPool, int32atomic } from '../../src/index.ts'; 6 6 import { increment } from './increment.ts'; 7 7 8 - const counter = new AtomicInt32(); 8 + const counter = int32atomic(); 9 9 const pool = workerPool(4); 10 10 11 11 // Fire off 100 increments across 4 workers