-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Client and server mods as feature toggles #2223
Comments
I've wanted to provide this before, but wasn't sure how badly this was desired, and I started running into annoyances of internal code that was "unused" when one or both features aren't enabled, so I gave up. If it's desirable to add, then I think these requirements exist:
|
Thanks for the considerate and thoughtful response. I'll leave this issue open for now to see if accumulates some responses, in support of or otherwise, to gauge interest. |
I'd like to land this in the upcoming 0.14 release. @softprops do you want take this on now? |
I could give it a shot. Could this be as simple as a set of cargo features enabled by default that when enable conditionally wire into lib.rs around here? |
Probably yes, with complexity likely hiding just below the surface. I'd say start with For example, I'm doing a similar thing in #2251 (http2 done, http1 in progress). |
cc #2223 BREAKING CHANGE: The HTTP client of hyper is now an optional feature. To enable the client, add `features = ["client"]` to the dependency in your `Cargo.toml`.
cc #2223 BREAKING CHANGE: The HTTP client of hyper is now an optional feature. To enable the client, add `features = ["client"]` to the dependency in your `Cargo.toml`.
cc #2223 BREAKING CHANGE: The HTTP server code is now an optional feature. To enable the server, add `features = ["server"]` to the dependency in your `Cargo.toml`.
cc hyperium#2223 BREAKING CHANGE: The HTTP client of hyper is now an optional feature. To enable the client, add `features = ["client"]` to the dependency in your `Cargo.toml`.
cc hyperium#2223 BREAKING CHANGE: The HTTP server code is now an optional feature. To enable the server, add `features = ["server"]` to the dependency in your `Cargo.toml`.
When using hyper in libraries I often find myself using it in one of two ways and not often both at the same time. I'm either writing clients or servers. Servers can contain clients for other servers in application contexts but in library contexts I find this often not the case.
There is some discussion going on in rusoto about bundled client sizes (rusoto/rusoto#1722) there are multiple factors that contribute to this but I'd like to try and make strawman argument for being able to reduce it's hyper bindings down to only what is needed for a client sdk.
Before putting potentially wasted effort into this, I wanted to see if you think there are good reasons why this might not yield meaningful value or of you know of others actively doing this research already.
The text was updated successfully, but these errors were encountered: