invoke has nice syntax for controlling the flow of individual anonymous functions, but it lacks semantics for operating on arrays of functions.
I'm currently thinking of an API that looks like:
// batch of sequential functions
invoke(batch).sequentially().rescue(function (err) {
// error handler
}).end(initial, function (results) {
// success handler
});
// batch of parallel functions
invoke(batch).inParallel().rescue(function (err) {
// error handler
}).end(initial, function (results) {
// success handler
});
// complex flow
invoke(function (data, callback) {
// ...
}).then(sequentialBatch).sequentially().then(function (data, callback) {
// ...
}).then(parallelBatch).inParallel().rescue(function (err) {
// error handler
}).end(initial, function (results) {
// success handler
});
invoke has nice syntax for controlling the flow of individual anonymous functions, but it lacks semantics for operating on arrays of functions.
I'm currently thinking of an API that looks like: