Async-Bucket
A minimal library for throttling async concurrency. Rewrited version of async-limiter.
Example
Copied from async-limiter.
var Limiter = require('async-bucket');
var t = new Limiter({concurrency: 2});
var results = [];
t.push(function (cb) {
results.push('two');
cb();
});
t.push(
function (cb) {
results.push('four');
cb();
},
function (cb) {
results.push('five');
cb();
}
);
t.unshift(function (cb) {
results.push('one');
cb();
});
t.splice(2, 0, function (cb) {
results.push('three');
cb();
});
t.onDone(function () {
console.log('all done:', results)
});