Skip to content

Instantly share code, notes, and snippets.

@youxiachai
Created June 17, 2014 08:45
Show Gist options
  • Save youxiachai/0fb3c7cd743d836d5070 to your computer and use it in GitHub Desktop.
Save youxiachai/0fb3c7cd743d836d5070 to your computer and use it in GitHub Desktop.
嵌套async练习
var async = require('async');
async.eachSeries(['2m内容'], function (item, callback) {
async.parallel([
function (subcallback) {
//1
},
function (subcallback){
//2
}
], function (err, subResult) {
async.eachSeries(['再循环N次'], function (s2item, s2callback){
s2callback()
}, function (err){
async.parallel([
function (subcallback) {
//1 再战N个
}
], function (err){
//这条数据任务的完成标识
callback()
})
})
})
}, function (err){
console.log(err);
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment