Nodejs in-process blocking FIFO queue implementation.
Queue with max cocurrency.
npm install block-queue
var queue = require('block-queue');
var q = queue(1, function(task, done) {
// working on task..
done();
});
q.push('task1');
q.push('task2');
q.push('task3');
See also: example-1.js and example-2.js.
- cocurrency, integer, optional, default: 1
- reducer, function, required should be called with 2 parameters: task, done.
- task, mixed, required.
MIT.