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.

test(serve): fix Buffer type and add test timeout for spike

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

+2 -2
+2 -2
test/serve/spike.test.ts
··· 5 5 import { Worker } from 'node:worker_threads'; 6 6 7 7 describe('fd-passing spike', () => { 8 - it('fd extracted on main and reconstructed as net.Socket on a worker thread', async () => { 8 + it('fd extracted on main and reconstructed as net.Socket on a worker thread', { timeout: 5000 }, async () => { 9 9 // Spawn worker with an inline string source 10 10 const workerCode = ` 11 11 const { parentPort } = require('node:worker_threads'); ··· 44 44 // Client connects, reads the reply 45 45 const client = connect(port); 46 46 const chunks: Buffer[] = []; 47 - client.on('data', (c) => chunks.push(c)); 47 + client.on('data', (c) => chunks.push(Buffer.isBuffer(c) ? c : Buffer.from(c))); 48 48 await once(client, 'end'); 49 49 50 50 assert.equal(Buffer.concat(chunks).toString('utf8'), 'hello\n');