-
Notifications
You must be signed in to change notification settings - Fork 2
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
refactor: Consolidate the blobs API #42
base: main
Are you sure you want to change the base?
Conversation
Documentation for this PR has been generated and is available at: https://n0-computer.github.io/iroh-blobs/pr/42/docs/iroh_blobs/ Last updated: 2025-01-03T16:36:33Z |
Also document the remaining things in net_protocol
not worth it at this point
get::{db::get_to_db_in_steps, error::GetError}, | ||
store::Store, | ||
get::Error, | ||
store::{get_to_db_in_steps, FetchState, FetchStateNeedsConn, Store}, |
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.
so there is get
and fetch
now? this is confusing 😅
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.
everything that needs a store is in the store module. I might even make it a fn on the store traits (see the OO or not OO question)
One reason for this is that I think it would be neat if you could hide the entire store behind a ff, but to do that you must make sure that store stuff is not all over the place, otherwise you will go crazy.
src/get/progress.rs
Outdated
|
||
/// Progress updates for the get operation. | ||
#[derive(Debug, Clone, Serialize, Deserialize)] | ||
pub enum DownloadProgress { |
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.
can we normalize get
, download
and fetch
? they sound like the same thing for most users
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.
Normalize to what? get, download or fetch? I guess the most descriptive is download, given that it is a downloader.
But then get is more accurate for the case where the stuff is already local.
Description
The API has grown quite a bit. This is an attempt to structure it a bit better.
There is going to be a much larger change later when we add multi-provider downloads. That requires changing the entire progress story. But for now this just attempts a small clean up.
Breaking Changes
Notes & open questions
Maybe not for this PR, but there is one open question. Basically to OO or not to OO.
There are a large number of fns that need a store. Currently these are fns that just take a impl Store as first or second parameter. I could make these member functions of the trait. E.g. handle_connection(store, conn, events) could be store.handle_connection(conn, events). Would that be easier to discover for people?
Change checklist