Another experimental series and parallel control flow node library
npm install fallGravity =~ 9.81 m/s
A fall is a series of tasks (currently series, but the ability to
mix in parallel will be supported soon) that behaves in a fashion
similar to the way we process http in node.
A standard fall function looks something like this:
``js
function doSomething(params, output) {
var name = params.name;
setTimeout(function() {
output.write({ age: 35 });
}, 100);
}
`
In each case the runner is provided with some parameters that have
been created by previous runners, and then produces output using the
output.write function.
__NOTE:__ Once the write function is called the descent into the output.write
remaining tasks will continue, so should be treated
in a similar fashion to a callback unless you want rudimentary streams
behaviour. Although, I would encourage you to look to one of the
existing streaming implementations for that.
At this stage, for two reasons:
1. I find myself allergic to writing thenasync
2. I don't yet quite grok
fantasy-promises and
needed something to make linear (and sometimes parallel) control flow
tidier than my current mashing together of function calls.
Create a new fall runner that will be ok with be passed to the
fall.into function.
Fall down the runners...
The fall.into` function is generally designed to be call as a
reducer.