I'm using Amazon's S3 Cloud Object Storage to store files from my application. And I need to increase performance of the file uploading/downloading. From what I've seen, S3 doesn't allow you to do a GetObjects that allows you to download multiple files at once. So my idea is to create a function returns its data synchronously, but it runs asynchronously. Basically, download the files in parallel, but only return the list of files only when all the files have been downloaded.
I don't work with C# that much so I'll work some pseudo code to try to make to make it more clear:
GetObjects(listOfObjectKeys){
byte listOfFiles;
foreach (int i in listOfObjectKeys) {
listOfFiles.append((async)S3.GetObject(listOfObjectKeys[i]));
}
return listOfFiles;
}
Is there a way to achieve this?
Edit: forgot to add that the S3.GetObject is not an asynchronous function, I just want to know if I can call it multiple times in parallel instead of having to wait for the previous call to be over