Skip to content

Commit 8327958

Browse files
authored
Merge pull request #77 from cgwalters/reader-take
client: Handle get_blob futures being polled serially
2 parents fbe78a9 + c8ebd96 commit 8327958

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

examples/client.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,6 @@ async fn fetch_container_to_devnull(o: GetMetadataOpts) -> Result<()> {
9696
let mut devnull = tokio::io::sink();
9797
let copier = tokio::io::copy(&mut blob, &mut devnull);
9898
let (copier, driver) = tokio::join!(copier, driver);
99-
dbg!(&copier);
100-
dbg!(&driver);
10199
copier?;
102100
driver?;
103101
}

src/imageproxy.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -545,6 +545,11 @@ impl ImageProxy {
545545
/// <https://github.com/opencontainers/image-spec/blob/main/descriptor.md>
546546
///
547547
/// The requested size and digest are verified (by the proxy process).
548+
///
549+
/// Note that because of the implementation details of this function, you should
550+
/// [`futures::join!`] the returned futures instead of polling one after the other. The
551+
/// secondary "driver" future will only return once everything has been read from
552+
/// the reader future.
548553
#[instrument]
549554
pub async fn get_blob(
550555
&self,

0 commit comments

Comments
 (0)