Memory-optimized promise-based queue with concurrency control (v1.0.0, latest stable, active development). Designed to prevent Out Of Memory errors when processing large datasets from streams by providing a blocking enqueue that pauses the producer until a slot is available. Unlike p-queue or Bluebird.map, this queue integrates with Node.js streams to control backpressure without buffering all items in memory. Ships TypeScript types, supports Node >=14, and includes priority queuing. Good for rate-limiting async operations on large data.
npm install promise-blocking-queueNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Creates a blocking queue with concurrency 2, enqueues 5 async tasks that simulate work, and waits for idle.
Always await queue.enqueue() unless you intentionally want to fire-and-forget. Use await Promise.all() for multiple enqueues if needed.
When writing to a writable stream within a task, check if stream.write() returns false (indicating backpressure), then wait for 'drain' event before enqueuing more tasks.
Do not rely on priority ordering. All tasks are processed in FIFO order for now.
Always specify `concurrency` as a positive integer to enforce rate limiting. Example: `new BlockingQueue({ concurrency: 2 })`.Use import { BlockingQueue } from 'promise-blocking-queue' instead of import BlockingQueue from 'promise-blocking-queue'.Run npm install promise-blocking-queue and ensure no spelling mistakes.
Update to latest version (1.0.0). If still issue, check TypeScript version >=4.0.
No dependency data recorded yet.