如何将异步/等待与async control flows结合使用?:
async.parallel([
(next) => asyncFN1,
(next) => asyncFN2,
(next) => {
Model.find(filter).exec( async(err, result) => {
if (await asyncFn3()){
return next("Some err")
}
return next(null, result)
})
}
], callback)
1)是否可以使用异步/等待和回调相结合来进行控制流?
2)我需要处理Promise异步/等待返回吗?
3)异步可以直接在控制流上吗?例如
async.parallel([
(next) => asyncFN1,
async (next) => {
const result = await asyncFN4()
return next(null, result)
}