-
- Downloads
Allow to specify a read buffer initial capacity when creating ByteStream from a file (#1238)
* Allow to specify a read buffer initial capacity when creating ByteStream from a file The behaviour of the existing ByteStream::from_file / ByteStream::from_path is unchanged (using a default buffer capacity of 4k, which corresponds to Tokio's ReaderStream default buffer capacity). Using higher buffer sizes can result in a large reduction in CPU during S3 uploads, at the cost of memory increase. * Rename len to file_size This makes the distinction with the buffer size clearer * Use a builder to specify advanced options to create a ByteStream * Improved comments * Specify the unit to use for PathBodyBuilder.with_file_size * Improved comments following review * Rename PathBodyBuilder to FsBuilder * Renaming in FsBuilder - renames `with_buffer_size` to `buffer_size` - renames `with_file_size` to `file_size` - renames `byte_stream` to `build` * Make PathBody private * Updated API for FsBuilder * Document panic behavior of ByteStream::build * Document ByteStream::read_from * Move ByteStream::read_from No functional change * Update rust-runtime/aws-smithy-http/src/byte_stream.rs a -> an Co-authored-by:Russell Cohen <russell.r.cohen@gmail.com> Co-authored-by:
Russell Cohen <rcoh@amazon.com>
Loading
Please register or sign in to comment