soto-project / soto

Swift SDK for AWS that works on Linux, macOS and iOS
https://soto.codes
Apache License 2.0
867 stars 81 forks source link

PutObjectRequest API how to get progress #707

Closed chenanghui closed 3 months ago

chenanghui commented 5 months ago

PutObjectRequest API how to get progress

adam-fowler commented 5 months ago

The PutObject API accepts an AsyncSequence of ByteBuffers. You could break up the buffer you are sending into an AsyncSequence of buffers and then use map to track the buffers the HTTPClient is reading from this sequence.

Alternatively instead of map you could use something like this https://github.com/soto-project/soto/blob/main/Sources/Soto/Extensions/S3/ReportSizeByteBufferSequence.swift