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

Make client able to use non-Send executor #3017

Closed
seanmonstar opened this issue Oct 20, 2022 · 1 comment · Fixed by #3184
Closed

Make client able to use non-Send executor #3017

seanmonstar opened this issue Oct 20, 2022 · 1 comment · Fixed by #3184
Labels
A-client Area: client. B-breaking-change Blocked: this is an "API breaking change". 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

This likely needs to be done before 1.0, because I suspect it involves adding a generic to a few types. But it's likely too late to fit into RC1.

The client code currently spawns a couple tasks for a connection, but does so by requiring the Executor<Box<dyn Future + Send>>, so we can spawn multiple. We can't make the internal type public, but we need to propagate the Send bounds of the IO and body types. So, we should change it to have bounds similar to the server::conn::http2, essentially an extension trait that means E: Executor<InternalFutureType<IO, B>>.

A way we can tell this all works is that we should be able to augment the single-threaded example file with a client as well.

Other relevant issues: #2341

@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. B-breaking-change Blocked: this is an "API breaking change". labels Oct 20, 2022
@seanmonstar seanmonstar added this to the 1.0 Final milestone Oct 20, 2022
@seanmonstar seanmonstar moved this to Todo in hyper 1.0 Oct 20, 2022
@seanmonstar seanmonstar modified the milestones: 1.0 Final, 1.0 RC2 Nov 8, 2022
@seanmonstar seanmonstar modified the milestones: 1.0 RC2, 1.0 RC3 Dec 29, 2022
@seanmonstar seanmonstar modified the milestones: 1.0 RC3, 1.0 RC4 Feb 24, 2023
@Ruben2424
Copy link
Contributor

I will try to implement this.

@seanmonstar seanmonstar added E-hard Effort: hard. Likely requires a deeper understanding of how hyper's internals work. and removed E-medium Effort: medium. Some knowledge of how hyper internal works would be useful. labels May 1, 2023
@seanmonstar seanmonstar linked a pull request Jun 29, 2023 that will close this issue
@seanmonstar seanmonstar moved this from Todo to In Progress in hyper 1.0 Jun 29, 2023
seanmonstar pushed a commit that referenced this issue Jun 29, 2023
Closes #3017

BREAKING CHANGE: `client::conn::http2` types now use another generic for an `Executor`.
  Code that names `Connection` needs to include the additional generic parameter.
@github-project-automation github-project-automation bot moved this from In Progress to Done in hyper 1.0 Jun 29, 2023
mmastrac added a commit to denoland/deno that referenced this issue Jul 31, 2023
Includes a lightly-modified version of hyper-util's `TokioIo` utility. 

Hyper changes:

v1.0.0-rc.4 (2023-07-10)
Bug Fixes

    http1:
http1 server graceful shutdown fix (#3261)
([f4b51300](hyperium/hyper@f4b5130))
send error on Incoming body when connection errors (#3256)
([52f19259](hyperium/hyper@52f1925),
closes hyperium/hyper#3253)
properly end chunked bodies when it was known to be empty (#3254)
([fec64cf0](hyperium/hyper@fec64cf),
closes hyperium/hyper#3252)

Features

client: Make clients able to use non-Send executor (#3184)
([d977f209](hyperium/hyper@d977f20),
closes hyperium/hyper#3017)
    rt:
replace IO traits with hyper::rt ones (#3230)
([f9f65b7a](hyperium/hyper@f9f65b7),
closes hyperium/hyper#3110)
add downcast on Sleep trait (#3125)
([d92d3917](hyperium/hyper@d92d391),
closes hyperium/hyper#3027)
service: change Service::call to take &self (#3223)
([d894439e](hyperium/hyper@d894439),
closes hyperium/hyper#3040)

Breaking Changes

Any IO transport type provided must not implement hyper::rt::{Read,
Write} instead of tokio::io traits. You can grab a helper type from
hyper-util to wrap Tokio types, or implement the traits yourself, if
it's a custom type.
([f9f65b7a](hyperium/hyper@f9f65b7))
client::conn::http2 types now use another generic for an Executor. Code
that names Connection needs to include the additional generic parameter.
([d977f209](hyperium/hyper@d977f20))
The Service::call function no longer takes a mutable reference to self.
The FnMut trait bound on the service::util::service_fn function and the
trait bound on the impl for the ServiceFn struct were changed from FnMut
to Fn.
0xE282B0 pushed a commit to 0xE282B0/hyper that referenced this issue Jan 12, 2024
Closes hyperium#3017

BREAKING CHANGE: `client::conn::http2` types now use another generic for an `Executor`.
  Code that names `Connection` needs to include the additional generic parameter.
0xE282B0 pushed a commit to 0xE282B0/hyper that referenced this issue Jan 16, 2024
Closes hyperium#3017

BREAKING CHANGE: `client::conn::http2` types now use another generic for an `Executor`.
  Code that names `Connection` needs to include the additional generic parameter.

Signed-off-by: Sven Pfennig <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-client Area: client. B-breaking-change Blocked: this is an "API breaking change". 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.

2 participants