surfacecurve-async
Coordinate asynchronous control flow (a.k.a. yet another async library).
Overview
var async = require("surfacecurve-async");
function processItem(data, next) {
...
}
// Create a processing queue that runs up to 4
// concurrent callbacks.
//
var queue = new async.AsyncQueue({ limit : 4 });
for (var i = 0; i < dataItems.length; ++i)
queue.push(processItem, dataItems[i]);
queue.finish(function() {
console.log("Finished");
});
Examples
See the examples
subdirectory. Simply run node on any of the files and view the source:
$ node examples/example-00.js