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

Client as tower::Service #88

Merged
merged 7 commits into from
Jul 1, 2024
Merged

Client as tower::Service #88

merged 7 commits into from
Jul 1, 2024

Conversation

alexrudy
Copy link
Owner

@alexrudy alexrudy commented Jun 30, 2024

Refactor the Client to be a tower::Service internally.

This takes advantage of the tower::Service trait and related ecosystem
to provide additional helpers and middleware when using a Client.

alexrudy added 7 commits June 28, 2024 00:49
This allows additional layers to be applied to the client. Some default layers can then be used (e.g. always add a user-agent header for the outbound request).

The exterior API remains familiar, except that clients must now be mutable, which is consistent with other implementations.

This will allow for future APIs (like a cheaply-cloneable client backed by a channel) which add ergonomic extension points.
It contains a type-erased service which is built from components that can add features to the client
@alexrudy alexrudy merged commit ba762d6 into main Jul 1, 2024
11 checks passed
@alexrudy alexrudy deleted the client/service branch July 1, 2024 00:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant