piscina
Version:
A fast, efficient Node.js Worker Thread Pool implementation
14 lines (11 loc) • 398 B
text/typescript
import assert from 'node:assert/strict';
import { test } from 'node:test';
import { resolve } from 'node:path';
import Piscina from '..';
test('can destroy pool while tasks are running', () => {
const pool = new Piscina({
filename: resolve(__dirname, 'fixtures/eval.js')
});
setImmediate(() => pool.destroy());
assert.rejects(pool.run('while(1){}'), /Terminating worker thread/);
});