Skip to content

hyper-util: deconstruct legacy Pool into composable Services #3849

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

Open
seanmonstar opened this issue Mar 3, 2025 · 0 comments
Open

hyper-util: deconstruct legacy Pool into composable Services #3849

seanmonstar opened this issue Mar 3, 2025 · 0 comments
Labels
A-client Area: client. B-rfc Blocked: More comments would be useful in determine next steps. C-feature Category: feature. This is adding a new feature. E-medium Effort: medium. Some knowledge of how hyper internal works would be useful. K-hyper-util Crate: hyper-util

Comments

@seanmonstar
Copy link
Member

The internal connection pool in the legacy client does many things, and it'd be better if it were broken up into several pieces and those made public, so people can more easily construct their own pools. Such as a racing cache pool, singleton pool for HTTP/2, an Either pool to combine them.

When looking how the legacy Client uses the pool, they easily fit into a MakeService (a Service that returns a Service) pattern. After "making" a service (the http1 or http2 (SendRequest, Connection) bit), a request is then sent, and afterwards the service is dropped. If pooling were disabled, that would just make a new connection each time. If a pool is used, likely that "made" service would return some internal pieces in its Drop implementation, so that making a new service later would reuse the existing connection.

This is likely a more complicated task, and a design document would be a good next step. I'll also add here some subtasks for individual pool types worth adding.

@seanmonstar seanmonstar added A-client Area: client. B-rfc Blocked: More comments would be useful in determine next steps. C-feature Category: feature. This is adding a new feature. E-medium Effort: medium. Some knowledge of how hyper internal works would be useful. K-hyper-util Crate: hyper-util labels Mar 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-client Area: client. B-rfc Blocked: More comments would be useful in determine next steps. C-feature Category: feature. This is adding a new feature. E-medium Effort: medium. Some knowledge of how hyper internal works would be useful. K-hyper-util Crate: hyper-util
Projects
None yet
Development

No branches or pull requests

1 participant