I need to download a lot of files from S3 so I wrapped many calls to s3Client.getObject(request, destination)
with futures, but there's no mention of it being blocking so I'm afraid I might run into a race condition where all the download calls were made but the files weren't really downloaded yet.
Is it safe to assume this api is blocking since there's no mention of it being async?
To clarify, by blocking I mean that the flow won't continue after the s3Client.getObject(request, destination)
line until the download is finished.
CodePudding user response:
Looking at the code on Github, it is indeed blocking the call (invoke).
CodePudding user response:
TO use the latest non-blocking code (AWS SDK for Java V2), refer to this Github example. This shows how to use getObject using the asynchronous client.