http-rs / surf

Fast and friendly HTTP client framework for async Rust
https://docs.rs/surf
Apache License 2.0
1.45k stars 119 forks source link

Connection pooling in Client / HttpClient #224

Closed Fishrock123 closed 3 years ago

Fishrock123 commented 3 years ago

Kat Marchán (@zkat) did a bunch of work on this in https://github.com/orogene/orogene/blob/main/crates/oro-client/src/http_client/mod.rs and gave us permission to re-use specifically the pooling client code for Surf.

This needs to be implemented in http-client but might as well be tracked here.

Going to try to get to this this week. Would be easier (in a sense) if https://github.com/http-rs/surf/issues/217 was agreed upon and I didn't have to try to make this generic across all clients first-go.

Fishrock123 commented 3 years ago

So turns out Isahc does indeed have connection pooling of its own but I suspect we may not be making use of it. See https://docs.rs/isahc/0.9.8/isahc/struct.HttpClient.html

Fishrock123 commented 3 years ago

When https://github.com/http-rs/surf/pull/234 lands, the hyper-client will also have connection pooling built in.

Fishrock123 commented 3 years ago

http-client 6.3.0 (a minor upgrade, cargo update), includes connection pooling.