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

Middleware registration #70

Closed
rlabrecque opened this issue Oct 12, 2019 · 4 comments
Closed

Middleware registration #70

rlabrecque opened this issue Oct 12, 2019 · 4 comments
Labels
A-tonic C-enhancement Category: New feature or request E-help-wanted Call for participation: Help is requested to fix this issue.

Comments

@rlabrecque
Copy link

Feature Request

Currently tonic provides interceptor_fn but this is a little lower level than a lot of other solutions provide.

Ideally I could chain middleware functions without manually building my own stack inside an interceptor_fn.

See: #69, tower-rs/tower-grpc#86, https://github.com/grpc-ecosystem/go-grpc-middleware

@LucioFranco LucioFranco added A-tonic C-enhancement Category: New feature or request E-help-wanted Call for participation: Help is requested to fix this issue. labels Oct 13, 2019
@LucioFranco
Copy link
Member

Yeah so ideally we would use something like https://docs.rs/tower-layer/0.3.0-alpha.1/tower_layer/trait.Layer.html which achieves this. The issue right now is the extra api's around making these easier to define are not yet done. The interceptor_fn was the first attempt at trying to make an easy api for this. I would love to find a better one.

@mawenqi
Copy link

mawenqi commented Feb 10, 2020

so how could I do this in version 0.1.1? thanks

@LucioFranco
Copy link
Member

@davidpdrsn
Copy link
Member

This was solved as part of #651. The API for adding tower middleware to tonic clients and servers has been simplified quite a bit. Interceptors are now also based on tower Service so they are composable in the same way any Service is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-tonic C-enhancement Category: New feature or request E-help-wanted Call for participation: Help is requested to fix this issue.
Projects
None yet
Development

No branches or pull requests

4 participants