Skip to content
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

crate: add hyper-client feature #234

Merged
merged 1 commit into from Oct 22, 2020
Merged

Conversation

Fishrock123
Copy link
Member

Adds support for http-client/hyper_client, including global pooling for one-off surf methods.

Also adjusts client configuration to fallback once again, starting with the highest specificity (wasm) and allowing e.g. features = ["hyper-client"] to override the default.

@Fishrock123
Copy link
Member Author

Fishrock123 commented Sep 21, 2020

I have discovered that this still doesn't work because Clone was never implemented for http_client::hyper::HyperClient.

@Fishrock123 Fishrock123 removed this from the 2.0 milestone Sep 21, 2020
Fishrock123 added a commit to Fishrock123/http-client that referenced this pull request Sep 22, 2020
- Makes HyperClient impl Clone and Default
- Re-uses the internal hyper client for pooling and alloc efficiency
- Adds HyperClient::from_client()
- Always uses the HttpsConnector (has internal http fallback)

Required for hyper-client in Surf:
http-rs/surf#234
@Fishrock123 Fishrock123 force-pushed the hyper-client branch 2 times, most recently from 8329257 to 08ff108 Compare September 22, 2020 18:53
@Fishrock123
Copy link
Member Author

This now only waiting for http-rs/http-client#45

@Fishrock123
Copy link
Member Author

Fishrock123 commented Sep 23, 2020

Edit: actually nightly broke: rust-lang/rust#77089

Hmm, CI is failing because something in async-std?

error[E0046]: not all trait items implemented, missing: `as_flags`
   --> /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/async-std-1.6.4/src/fs/open_options.rs:303:5
    |
303 |     impl OpenOptionsExt for OpenOptions {
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `as_flags` in implementation
    |
    = help: implement the missing item: `fn as_flags(&self) -> std::result::Result<i32, futures_io::Error> { todo!() }`

@Fishrock123 Fishrock123 reopened this Sep 24, 2020
Fishrock123 added a commit to Fishrock123/http-client that referenced this pull request Sep 25, 2020
- Makes HyperClient impl Clone and Default
- Re-uses the internal hyper client for pooling and alloc efficiency
- Adds HyperClient::from_client()
- Always uses the HttpsConnector (has internal http fallback)

Required for hyper-client in Surf:
http-rs/surf#234
@jbr
Copy link
Member

jbr commented Oct 3, 2020

Is this targeted for 2.0.0?

@Fishrock123
Copy link
Member Author

No this can be in 2.1

Adds support for `http-client/hyper_client`, including global pooling for one-off surf methods.
@Fishrock123 Fishrock123 marked this pull request as ready for review October 9, 2020 22:55
@Fishrock123
Copy link
Member Author

http-client 6.1.0 has been released with the necessary changes. This is ready for review (if any).

@Fishrock123
Copy link
Member Author

Merging this, it's been open plenty long and there is little code here, all of which is behind a feature flag.

@Fishrock123 Fishrock123 merged commit 55c5d6a into http-rs:main Oct 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants