I want to perform a set of async tasks repeatedly in a loop. I tried using async library's waterfall approach to do something like
while(somethingIsTrue) {
async.waterfall([
function(callback) { ... },
function(callback) { ... },
], function(err) {
...
}
);
}
The problem I encountered was that the the first async function never got scheduled or rather executed and the loop kept on running, obviously because the loop didnt wait for the async functions to finish. I'm not so well verse with asynchronous programming and I would need help to come up with some pattern to solve this problem.