Summary 💡
Support someway of injecting reqwest::Client into gix, could be a builder method, or a global like with_reqwest_client, similar to how tracing/log does it (shame we don't have context in rustlang!)
Motivation 🔦
In cargo-binstall, we put a lot of configuration into reqwest::Client, including customised dns config.
Plus, having two clients means it cannot share the connection pool and dns record cache and dns connection pool.
https://github.com/cargo-bins/cargo-binstall/blob/c0ae9335b22cb4f297cdd1df049cd87bf2aa223f/crates/binstalk-downloader/src/remote.rs#L124
I know that gix use a blocking client and cargo-binstall uses an async one so one could argue sharing is not possible now, but looking at the reqwest blocking client source code it internally wraps an async one, so it should be trivial to add a TryFrom impl for async client to sync client
Summary 💡
Support someway of injecting
reqwest::Clientinto gix, could be a builder method, or a global likewith_reqwest_client, similar to how tracing/log does it (shame we don't have context in rustlang!)Motivation 🔦
In cargo-binstall, we put a lot of configuration into
reqwest::Client, including customised dns config.Plus, having two clients means it cannot share the connection pool and dns record cache and dns connection pool.
https://github.com/cargo-bins/cargo-binstall/blob/c0ae9335b22cb4f297cdd1df049cd87bf2aa223f/crates/binstalk-downloader/src/remote.rs#L124
I know that gix use a blocking client and cargo-binstall uses an async one so one could argue sharing is not possible now, but looking at the reqwest blocking client source code it internally wraps an async one, so it should be trivial to add a
TryFromimpl for async client to sync client