0
虽然我使用的是async.until()函数,但我发现测试没有被重复调用,尽管它返回false。因此函数没有被调用来执行下一个任务。在async.until(测试,函数,回调)测试函数没有被重复调用
var resultReceived = false;
async.until(function(){
console.log("Checking result : "+resultReceived);
return resultReceived;
}, function(callback){
try{
//do something
resultReceived = true;
}catch(err){
resultReceived = false;
}
}, function(result){
console.log("====================");
console.log(result);
callback(result);
});
是 - 因为异步意味着它不会等待以前的执行在启动之前完成,这是下一步 - 看到这个答案 http://stackoverflow.com/questions/748175/asynchronous-vs-synchronous-execution-what-does-it-really-mean – mike510a
是的,我明白。但是如果你检查这个文档[https://caolan.github.io/async/docs.html#until]它说它重复调用main函数,直到测试返回true。这就是为什么我想知道.. – Angshuman