Skip to content

Instantly share code, notes, and snippets.

@techsin
Created April 13, 2015 02:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save techsin/18a6b6d36ed0205a443a to your computer and use it in GitHub Desktop.
Save techsin/18a6b6d36ed0205a443a to your computer and use it in GitHub Desktop.
Testing asynchs functionality
function async1(cb,err) {
setTimeout(function () {
console.log(1);
cb();
}, 1000);
}
function async2(cb,err) {
setTimeout(function () {
cb(new Error());
}, 1000);
}
function async3(cb,err) {
setTimeout(function () {
console.log(3);
cb();
}, 1000);
}
async.series([
async1,
async2,
async3
], function (err) {
console.log(err);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment