codeforamerica/survey-api — pull request #20 by prashtx (2012-08-19 00:10:14+00:00)
Title: Separate async calls and chain programmatically

When we ensure the structure of the database, we need to do several
tasks, each of which is asynchronous. Manually chaining these together
results in a "pyramid of doom" and is difficult to read/modify later.
Instead, we define the tasks separately and use the `chain` function to
sequence the tasks.

Modify the chain/upgrade functions to be a little more general and to
proceed left-to-right through the array of tasks.

/cc @hampelm