Skip to content

refactor: HTTP backend abstraction#4

Open
edfloreshz wants to merge 1 commit into
mainfrom
feat/http-backends
Open

refactor: HTTP backend abstraction#4
edfloreshz wants to merge 1 commit into
mainfrom
feat/http-backends

Conversation

@edfloreshz
Copy link
Copy Markdown
Collaborator

This pull request introduces a major refactor to the download manager’s transport layer, making HTTP backend support pluggable and backend-agnostic. The reqwest dependency is now optional and behind a feature flag, and a new trait-based abstraction allows for custom HTTP or non-HTTP backends. The context and configuration code are updated to use this new design.

@edfloreshz edfloreshz self-assigned this Apr 7, 2026
@edfloreshz edfloreshz added the enhancement New feature or request label Apr 7, 2026
Comment thread src/backend/mod.rs
///
/// Returning `None` is safe; the download will proceed without pre-flight
/// metadata and no [`crate::events::Event::Probed`] event will be emitted.
fn probe_head<'a>(
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we rather abstract the HttpClient itself rather than abstracting specific requests?

What if we want to make other requests in the future, that means we would have to update this trait and and its implementor

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fair point

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How would you propose we do that? I could use some ideas.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants