Skip to content

Add methods that operate on arrays of functions #2

Description

@repeatingbeats

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
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions