arrayOfFunctions is an array with 1000+ functions in it. Each function is making an async call to AWS S3 to get an object's metadata.
Function:
function (cb) {$.when(getMetadata("bucketname","objectkey"))
.done(function (data) {
cb(null, data)
});
For a single function, it takes less than a second to read the metadata, if I execute 1000s of them one by one that will take 1 second per function.
How I call with async.parallel:
async.parallel(arrayOfFunctions, function (err, result) {
console.log(result);
}
});
If I use async.parallel, does it mean that all the functions are executed at once and parallelly? should I get results of all of them at once and just 1-2 seconds?
thanks