feat(nix-compat/wire/bytes/reader): support buffered reading
If our underlying reader supports AsyncBufRead, then we can too. Change-Id: If4b948c983400ca591c1c475bbcf7dc00d562040 Reviewed-on: https://cl.tvl.fyi/c/depot/+/11545 Reviewed-by: flokli <flokli@flokli.de> Tested-by: BuildkiteCI
This commit is contained in:
parent
ebad318ab3
commit
51e0f78e93
3 changed files with 195 additions and 6 deletions
|
|
@ -70,8 +70,7 @@ where
|
|||
} => {
|
||||
let (digest, size) = {
|
||||
let mut blob_writer = blob_service.open_write().await;
|
||||
// TODO(edef): fix the AsyncBufRead implementation of nix_compat::wire::BytesReader
|
||||
let size = tokio::io::copy(&mut reader, &mut blob_writer).await?;
|
||||
let size = tokio::io::copy_buf(&mut reader, &mut blob_writer).await?;
|
||||
|
||||
(blob_writer.close().await?, size)
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue