-
Notifications
You must be signed in to change notification settings - Fork 149
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
Optionally disable pulling in the tokio runtime #69
Conversation
Would you mind adding a no-default-features build to the Travis config to ensure this doesn't regress? |
I'm a bit wary that making
I don't see it in this PR, so I'm not sure about the details of this. Why can't hyper directly host this dedicated connector flavor, instead of pushing a feature flag to rev-dependencies (including this crate)? |
Before this patch, hyper-rustls required pulling in the tokio runtime due to it's use of `hyper::client::HttpConnector`. Unfortunately Fuchsia does not support tokio, which prevents our use of this library. This PR allows us to optionally disable pulling in tokio, and instead swap in our own version of the hyper `HttpConnector`.
@cramertj: good idea, I added it, and fixed the doctest to work with
Did you mean tokio? I'm not making hyper optional, I'm just allowing for the possibility of disabling hyper's runtime feature, which at the moment in tokio.
Our replacement for hyper's
I'd love it if we could do that, but unfortunately I think this is all a consequence of the current state of things with rust futures. With stable futures, I don't think there's a great way to abstract away executors, which is why the Hyper runtime is pretty tightly bound to tokio. Abstracting exectors is better supported in futures-preview, but that's still nightly only. Since hyper wants to be compatible with stable rust, there really isn't an option that we can use. However, |
Nevermind, I initially misread the manifest change. @erickt thanks for the followup and the references, with all the details I see the context and the trade-offs involved. I think it makes sense to land this now and hopefully re-unify Fuchsia support later on. I'd still leave some time for @ctz to chime in, in case he has some thoughts on this. |
This seems sensible to me. |
Before this patch, hyper-rustls required pulling in the tokio runtime due to it's use of
hyper::client::HttpConnector
. Unfortunately Fuchsia does not support tokio, which prevents our use of thislibrary. This PR allows us to optionally disable pulling in tokio, and instead swap in our own version of the hyper
HttpConnector
.If this PR is accepted, would it be possible for a new version to be cut that allows us to opt out of the tokio dependency? Thanks so much!