Skip to content

Make client able to use non-Send executor #3017

Closed
@seanmonstar

Description

@seanmonstar

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-clientArea: client.B-breaking-changeBlocked: this is an "API breaking change".C-featureCategory: feature. This is adding a new feature.E-hardEffort: hard. Likely requires a deeper understanding of how hyper's internals work.

    Type

    No type

    Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions