在执行“ n ”异步函数 后,我不知道如何执行回调,例如:
var after4AsyncOperation = function(){
//do something...
}
process.nextTick(function(){
//do stuff
})
process.nextTick(function(){
//do stuff
})
process.nextTick(function(){
//do stuff
})
process.nextTick(function(){
//do stuff
})
有没有一种方法可以after4AsyncOperation
在 4 个异步函数之后执行,而不必在另一个函数中编写函数,例如:
var after4AsyncOperation = function(){
//do something...
}
process.nextTick(function(){
//do stuff
process.nextTick(function(){
//do stuff
process.nextTick(function(){
//do stuff
process.nextTick(function(){
//do stuff
after4Asyncoperation();
})
})
})
})