aws-sdk-rust
aws-sdk-rust copied to clipboard
[request]: Progress callbacks on put object's
A note for the community
Community Note
- Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
- Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
- If you are interested in working on this issue, please leave a comment
Tell us about your request
Without a way to check on object uploads, a user's experience is severely hindered. Here's an already implemented api for the javascript sdk, https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3/ManagedUpload.html
Tell us about the problem you're trying to solve.
If someone tries to upload something there is currently no rust viable way to tell the user where they are in the request process.
Are you currently working around this issue?
Just presenting them with a loading dial.
Additional context
No response
Hey @TbirdDuncan, thanks for submitting this request. We don't expect that we'll get around to this before our 1.0 release but we've had several user requests for ergonomic high-level clients for specific services that would enable things like this. Providing those clients is on our radar, but we don't have an estimate of when we'll start that work.
Note that it should be possible to do this by providing your own SdkBody that can track progress: https://docs.rs/aws-smithy-http/0.38.0/aws_smithy_http/body/struct.SdkBody.html#method.from_dyn
@rcoh can you provide an example? It would help a lot :) Thank you
unfortunately, this isn't something we can pursue right now. The implementation of SdkBody could be a helpful starting point though! https://github.com/awslabs/aws-sdk-rust/blob/main/sdk/aws-smithy-http/src/body.rs#L200-L237
I ended up creating a little crate to handle this. The implementation is very naive but it works for a basic CLI I'm building. https://github.com/sapessi/trackable_s3_stream
Two notes:
- Life would be a lot easier if I was allowed to create a
ByteStreamfrom afutures::Streamimplementation directly - For some reason the SDK is not calling the
size_hintmethod in my stream. I also tried implementing hyper'sHttpBodyandhttp_body::Bodybut the method was not called. Instead, I'm passing the size manually to the S3 call in the example