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

Split the server Connection type into version-specific submodules #2851

Closed
seanmonstar opened this issue May 20, 2022 · 3 comments
Closed

Split the server Connection type into version-specific submodules #2851

seanmonstar opened this issue May 20, 2022 · 3 comments
Assignees
Labels
A-server Area: server. C-feature Category: feature. This is adding a new feature. E-hard Effort: hard. Likely requires a deeper understanding of how hyper's internals work.
Milestone

Comments

@seanmonstar
Copy link
Member

The server::conn type, Connection, should get version-specific types in submodules http1 and http2.

@seanmonstar seanmonstar added A-server Area: server. C-feature Category: feature. This is adding a new feature. E-hard Effort: hard. Likely requires a deeper understanding of how hyper's internals work. labels May 20, 2022
@seanmonstar seanmonstar added this to the 1.0 milestone May 20, 2022
@seanmonstar seanmonstar moved this to Todo in hyper 1.0 Jun 15, 2022
@tomkarw
Copy link
Contributor

tomkarw commented Sep 11, 2022

Hey @seanmonstar, I think I'd like to work on this next.

However, I need a few additional pointers before I can start:

  • Do we want to split only the Connection type, or all/most of the types in the server::conn? Is it just that we want to start simple, as the same argument can be made for the rest of the file?
  • There will be some code duplication. Are we okay with that, or should we abstract to some common free functions?
  • There are methods that require both http1 and http2 features, like upgrade_h2. Just to sanity check, that would be a method in http1::Connection that would still require both features enabled, take self by value and return http2::Connection.

I'd ask you for clarifications, confirmation that we still want to work on this, and maybe some new thoughts that you had about the topic.

@seanmonstar
Copy link
Member Author

Yes, this is something that still needs to be done.

Do we want to split only the Connection type, or all/most of the types in the server::conn?

Lemme take a look... I think that the types currently in server::conn should be remove from the public API. Connection should exist in both. So should a builder. The Addr* types are gone already. The Connecting should be gone as well, if not already.

Duplication ... should we abstract to some common free functions?

Some duplication is fine. It's also fine to refactor to some free functions in server::conn, as long as they stay private. De-duplication is less urgent than getting the API breaking changes in place, so we can ship the RC.

There are methods that require both http1 and http2 features, like upgrade_h2

Those should likely be removed, to start with. We can add them back in a way that hyper_util::server::AutoConnection could handle either version. (That's part of the goal of #2852, but the urgency is lower).

Michael-J-Ward added a commit to Michael-J-Ward/hyper that referenced this issue Sep 25, 2022
@Michael-J-Ward
Copy link
Contributor

Those should likely be removed, to start with. We can add them back in a way that hyper_util::server::AutoConnection could handle either version. (That's part of the goal of #2852, but the urgency is lower).

Do the connections then become simple-wrappers around the underlying dispatchers?

http2 definitely can be, and if we remove fallback from http1::Conneciton then I believe it can be as well

@seanmonstar seanmonstar moved this from Todo to In Progress in hyper 1.0 Oct 12, 2022
@seanmonstar seanmonstar self-assigned this Oct 12, 2022
Repository owner moved this from In Progress to Done in hyper 1.0 Oct 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-server Area: server. C-feature Category: feature. This is adding a new feature. E-hard Effort: hard. Likely requires a deeper understanding of how hyper's internals work.
Projects
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants