Created
April 13, 2015 02:26
-
-
Save techsin/18a6b6d36ed0205a443a to your computer and use it in GitHub Desktop.
Testing asynchs functionality
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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