A lightweight TypeScript library (v0.2.2, beta) for managing a queue of asynchronous tasks executed with a fixed concurrency using worker threads (or any async function). It exposes a single class AsyncWorkerQueue that supports customizable worker creation, error handling (remove/recreate workers on error), and optional pre-initialization. Unlike generic promise pools, it is tailored for worker-based parallelism with advanced error recovery. Ships TypeScript definitions.
npm install async-worker-queueNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows instantiation with 3 concurrent workers, explicit initialization, and enqueuing multiple tasks.
Use `import type { Execute } from 'async-worker-queue'` and provide T and R when using it as a type.Pin exact version and regularly check changelog for breaking changes.
Always call `await queue.initialise()` before enqueuing tasks if worker creation is expensive.
Match concurrency to the number of available CPU cores or the bottleneck resource limit.
Set `recreateWorkerOnError: true` to automatically restart failed workers.
Replace `import AsyncWorkerQueue from 'async-worker-queue'` with `import { AsyncWorkerQueue } from 'async-worker-queue'`.Ensure TypeScript strictness settings allow accessing public methods. The library is typed correctly; check for conflicting types.
No dependency data recorded yet.