-
Notifications
You must be signed in to change notification settings - Fork 213
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
fix(examples): Adjust and add examples #1968
Conversation
0240e02
to
14c14c6
Compare
} | ||
} | ||
drop(temp_pin); | ||
progress.send(DownloadProgress::AllDone).await?; | ||
anyhow::Ok(()) | ||
let _ = progress.send(DownloadProgress::AllDone).await; | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should also return the errors from the closure and check for errors here, currently this function will exit with Ok
even though it failed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I figured that we weren't await
ing the closure because the intended use case was to return once the download process was set up and expect users to listen for errors on the progress stream.
I refactored so that this was closer to the other methods that rely on progress streams for communciation.
Let me know if i'm missing something!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
## Description Fixes incorrect information in our `iroh/examples` Also adds an example that shows the most basic way to use iroh to fetch content. related to n0-computer#1929 ## Notes & open questions Unfortunately, we don't seem to have very simple APIs for fetching (that isn't just exporting the content to an external path). Working through this. Also adds: - `BlobDownloadProgress` - this takes a stream of `DownloadProgress` and puts it into a form that will poll the stream by calling `finish` - adjusts the `blob_download0` function to not eat certain errors ## Change checklist - [x] Self-review. - [x] Documentation updates if relevant.
Description
Fixes incorrect information in our
iroh/examples
Also adds an example that shows the most basic way to use iroh to fetch content.
related to #1929
Notes & open questions
Unfortunately, we don't seem to have very simple APIs for fetching (that isn't just exporting the content to an external path). Working through this.
Also adds:
BlobDownloadProgress
- this takes a stream ofDownloadProgress
and puts it into a form that will poll the stream by callingfinish
blob_download0
function to not eat certain errorsChange checklist