Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Allow client IO to be !Send #3363

Closed
3 tasks
seanmonstar opened this issue Oct 19, 2023 · 0 comments · Fixed by #3371
Closed
3 tasks

Allow client IO to be !Send #3363

seanmonstar opened this issue Oct 19, 2023 · 0 comments · Fixed by #3371
Labels
A-client Area: client. A-http1 Area: HTTP/1 specific. B-breaking-change Blocked: this is an "API breaking change". C-feature Category: feature. This is adding a new feature. E-medium Effort: medium. Some knowledge of how hyper internal works would be useful.
Milestone

Comments

@seanmonstar
Copy link
Member

Just like server::conn::http1::Connection can work with an IO type that isn't Send, because it has a with_upgrades() variant, we should make it so the client http1::Connection type doesn't require Send. This would be a breaking change, and so should happen before tagging 1.0.

I believe doing this is probably somewhat involved, let me lay out what I think needs to be done. If any step is unclear, or another way seems better, please comment :)

  • Remove Send from the T: Read + Write bounds for conn::http1::Connection
  • Provide a UpgradeableConnection in similar style to what is in server.
  • Update the single_threaded.rs example to use a !Send IO type for the client, to prove it works.
@seanmonstar seanmonstar added A-client Area: client. C-feature Category: feature. This is adding a new feature. E-medium Effort: medium. Some knowledge of how hyper internal works would be useful. A-http1 Area: HTTP/1 specific. B-breaking-change Blocked: this is an "API breaking change". labels Oct 19, 2023
@seanmonstar seanmonstar added this to the 1.0 milestone Oct 19, 2023
seanmonstar added a commit that referenced this issue Oct 23, 2023
This removes the requirement of the IO type from being `Send` for the
HTTP/1 client connection. To do so, the ability to perform
`hyper::upgrade`s had to be moved to a separate type which does require
the `Send` bound. This mirrors how the server types do it.

The `Connection` type now has a `with_upgrades()` method to convert.

Closes #3363

BREAKING CHANGE: If you use client HTTP/1 upgrades, you must call
  `Connection::with_upgrades()` to still work the same.
seanmonstar added a commit that referenced this issue Oct 23, 2023
This removes the requirement of the IO type from being `Send` for the
HTTP/1 client connection. To do so, the ability to perform
`hyper::upgrade`s had to be moved to a separate type which does require
the `Send` bound. This mirrors how the server types do it.

The `Connection` type now has a `with_upgrades()` method to convert.

Closes #3363

BREAKING CHANGE: If you use client HTTP/1 upgrades, you must call
  `Connection::with_upgrades()` to still work the same.
@seanmonstar seanmonstar moved this from Todo to In Progress in hyper 1.0 Oct 24, 2023
seanmonstar added a commit that referenced this issue Oct 26, 2023
This removes the requirement of the IO type from being `Send` for the
HTTP/1 client connection. To do so, the ability to perform
`hyper::upgrade`s had to be moved to a separate type which does require
the `Send` bound. This mirrors how the server types do it.

The `Connection` type now has a `with_upgrades()` method to convert.

Closes #3363

BREAKING CHANGE: If you use client HTTP/1 upgrades, you must call
  `Connection::with_upgrades()` to still work the same.
@github-project-automation github-project-automation bot moved this from In Progress to Done in hyper 1.0 Oct 26, 2023
0xE282B0 pushed a commit to 0xE282B0/hyper that referenced this issue Jan 12, 2024
This removes the requirement of the IO type from being `Send` for the
HTTP/1 client connection. To do so, the ability to perform
`hyper::upgrade`s had to be moved to a separate type which does require
the `Send` bound. This mirrors how the server types do it.

The `Connection` type now has a `with_upgrades()` method to convert.

Closes hyperium#3363

BREAKING CHANGE: If you use client HTTP/1 upgrades, you must call
  `Connection::with_upgrades()` to still work the same.
0xE282B0 pushed a commit to 0xE282B0/hyper that referenced this issue Jan 16, 2024
This removes the requirement of the IO type from being `Send` for the
HTTP/1 client connection. To do so, the ability to perform
`hyper::upgrade`s had to be moved to a separate type which does require
the `Send` bound. This mirrors how the server types do it.

The `Connection` type now has a `with_upgrades()` method to convert.

Closes hyperium#3363

BREAKING CHANGE: If you use client HTTP/1 upgrades, you must call
  `Connection::with_upgrades()` to still work the same.

Signed-off-by: Sven Pfennig <s.pfennig@reply.de>
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
A-client Area: client. A-http1 Area: HTTP/1 specific. B-breaking-change Blocked: this is an "API breaking change". C-feature Category: feature. This is adding a new feature. E-medium Effort: medium. Some knowledge of how hyper internal works would be useful.
Projects
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant