aws-sdk-rust icon indicating copy to clipboard operation
aws-sdk-rust copied to clipboard

[request]: Progress callbacks on put object's

Open TbirdDuncan opened this issue 3 years ago • 5 comments
trafficstars

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

TbirdDuncan avatar Mar 03 '22 15:03 TbirdDuncan

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.

Velfi avatar Mar 07 '22 19:03 Velfi

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 avatar Mar 07 '22 21:03 rcoh

@rcoh can you provide an example? It would help a lot :) Thank you

evoxmusic avatar Mar 21 '22 22:03 evoxmusic

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

rcoh avatar Mar 24 '22 17:03 rcoh

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 ByteStream from a futures::Stream implementation directly
  • For some reason the SDK is not calling the size_hint method in my stream. I also tried implementing hyper's HttpBody and http_body::Body but the method was not called. Instead, I'm passing the size manually to the S3 call in the example

sapessi avatar Dec 09 '22 18:12 sapessi