0.2.0 • Published 11 years ago

fall v0.2.0

Weekly downloads
1
License
-
Repository
github
Last release
11 years ago

fall

Gravity =~ 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:

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 remaining tasks will continue, so output.write 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.

Why fall?

At this stage, for two reasons:

  1. I find myself allergic to writing then
  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 async function calls.

Fall Reference

fall(runner)

Create a new fall runner that will be ok with be passed to the fall.into function.

fall.down(runners)

Fall down the runners...

fall.into(fn)

The fall.into function is generally designed to be call as a reducer.

0.3.0

11 years ago

0.2.0

11 years ago

0.1.0

11 years ago

0.0.1

11 years ago