A minimal Node.js in-process blocking FIFO queue implementation. Version 0.0.2 is the latest stable release. Provides a simple concurrency-limited task queue with a reducer pattern. Unlike async.queue, this library blocks on push when the internal buffer is full, enforcing backpressure. Suitable for simple in-process task orchestration where flow control is needed.
npm install block-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, pushes three tasks. The reducer processes tasks sequentially per slot.
Ensure the reducer always calls the done callback, even on error.
Consider using more modern libraries like async.queue or p-limit with promise support.
Wrap reducer body in try-catch and handle errors manually.
Be aware that currently executing tasks will continue.
Pass a proper function: function(task, done) { ... }Use queue() without new: const q = queue(1, reducer);
Provide a task: q.push('myTask');No dependency data recorded yet.