Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

It's easy to forget awaiting DownloadProgress in the current download API #26

Open
matheus23 opened this issue Dec 3, 2024 · 0 comments

Comments

@matheus23
Copy link
Member

matheus23 commented Dec 3, 2024

iroh::blobs::Client::download returns a DownloadProgress which needs to be awaited, too, if you want to wait for the download to finish.

So node.blobs().download(hash, ...).await? is not enough to wait for a download to finish.
You also need node.blobs().download(hash, ...).await?.await? (or alternatively call .finish().await? on the DownloadProgress).

This should be documented in the .download function's docs.
I also suggested renaming .download to .start_download, but that seemed like a more controversial change.

@n0bot n0bot bot added this to iroh Jan 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

No branches or pull requests

1 participant