Skip to content

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

Closed
@matheus23

Description

@matheus23

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    ✅ Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions