Created
April 6, 2016 12:17
-
-
Save shaikh-shahid/7011d3983483a291ed03fd8b328cadbc to your computer and use it in GitHub Desktop.
This file contains 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
var async = require('async'); | |
async.forEach(someData,function(singleData,callback){ | |
async.series(); | |
//OR | |
async.paralle(); | |
//OR | |
async.waterfall(); | |
},function(err,data) { | |
// final callback | |
}); | |
// going more deep. | |
async.forEach(someData,function(singleData,callback){ | |
async.waterfall([ | |
function(callback) { | |
async.forEachLimit(somedata,100,function(singleData,callback){ | |
// You can use more combo here too. | |
callback(null); | |
},function(err) { | |
// final callback | |
// Now call the callback of waterfall. | |
callback(null,"No error"); | |
}); | |
} | |
],function(err,data) { | |
// callback of top async.forEach() | |
callback(null); | |
}); | |
},function(err) { | |
// final callback | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment