Skip to content

Create a Map pool util #3979

@seanmonstar

Description

@seanmonstar

In hyper-util, create a Map type that can be used to route requests to sub-services. It's important that the Map be able to extract custom key types, while still using the full request information to construct the mapped service. This allows for users to define their own pool keys, and also allow connectors to consider extensions or other types on the request, not just the Uri.

Because of this kind of routing, Map itself cannot really impl Service. It wouldn't know how to propagate backpressure in poll_ready, since it doesn't know which service it will call. Therefore, it's up to the user of a Map to determine how and if to handle that problem.

See more in the proposal at #3948.

Metadata

Metadata

Assignees

Labels

A-clientArea: client.C-featureCategory: feature. This is adding a new feature.K-hyper-utilCrate: hyper-util

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions