Skip to content

Instantly share code, notes, and snippets.

@cgkio
Created September 18, 2013 02:55
Show Gist options
  • Save cgkio/6603902 to your computer and use it in GitHub Desktop.
Save cgkio/6603902 to your computer and use it in GitHub Desktop.
example of node.js Async series function
async.series({
one: function (callback) {
setTimeout(function () {
callback(null, 1);
}, 200);
},
two: function (callback) {
setTimeout(function () {
callback(null, 2);
}, 100);
}
},
function (err, results) {
// results is now equal to: {one: 1, two: 2}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment