- Fixed and dynamic pool size :white_check_mark:
- Easy switch from a pool type to another :white_check_mark:
- No runtime dependencies :white_check_mark:
- Fixed and dynamic pool size :white_check_mark:
- Easy switch from a pool type to another :white_check_mark:
- No runtime dependencies :white_check_mark:
- Support CommonJS, ESM, and TypeScript :white_check_mark:
- Support for [worker_threads](https://nodejs.org/api/worker_threads.html) and [cluster](https://nodejs.org/api/cluster.html) Node.js modules :white_check_mark:
- Support multiple task functions :white_check_mark:
- Support CommonJS, ESM, and TypeScript :white_check_mark:
- Support for [worker_threads](https://nodejs.org/api/worker_threads.html) and [cluster](https://nodejs.org/api/cluster.html) Node.js modules :white_check_mark:
- Support multiple task functions :white_check_mark:
// a fixed worker_threads pool
const pool = new FixedThreadPool(availableParallelism(), './yourWorker.js', {
// a fixed worker_threads pool
const pool = new FixedThreadPool(availableParallelism(), './yourWorker.js', {
// or a dynamic worker_threads pool
const pool = new DynamicThreadPool(Math.floor(availableParallelism() / 2), availableParallelism(), './yourWorker.js', {
// or a dynamic worker_threads pool
const pool = new DynamicThreadPool(Math.floor(availableParallelism() / 2), availableParallelism(), './yourWorker.js', {
- [Javascript](./examples/javascript/)
- [Typescript](./examples/typescript/)
- [HTTP client pool](./examples/typescript/http-client-pool/)
- [Javascript](./examples/javascript/)
- [Typescript](./examples/typescript/)
- [HTTP client pool](./examples/typescript/http-client-pool/)
- [HTTP server pool](./examples/typescript/http-server-pool/)
- [Express worker_threads pool](./examples/typescript/http-server-pool/express-worker_threads/)
- [HTTP server pool](./examples/typescript/http-server-pool/)
- [Express worker_threads pool](./examples/typescript/http-server-pool/express-worker_threads/)
- [Fastify worker_threads pool](./examples/typescript/http-server-pool/fastify-worker_threads/)
- [Fastify cluster pool](./examples/typescript/http-server-pool/fastify-cluster/)
- [Fastify worker_threads pool](./examples/typescript/http-server-pool/fastify-worker_threads/)
- [Fastify cluster pool](./examples/typescript/http-server-pool/fastify-cluster/)
- [WebSocket server pool](./examples/typescript/websocket-server-pool/)
- [ws worker_threads pool](./examples/typescript/websocket-server-pool/ws-worker_threads/)
- [WebSocket server pool](./examples/typescript/websocket-server-pool/)
- [ws worker_threads pool](./examples/typescript/websocket-server-pool/ws-worker_threads/)