Skip to content
This repository has been archived by the owner on Apr 16, 2020. It is now read-only.

Examples using tower-grpc with middleware #86

Open
jakobdalsgaard opened this issue Oct 7, 2018 · 4 comments
Open

Examples using tower-grpc with middleware #86

jakobdalsgaard opened this issue Oct 7, 2018 · 4 comments
Labels

Comments

@jakobdalsgaard
Copy link

I was just wondering if anyone has an example of a running tower-grpc server that uses some of the tower middleware? I know that we currently do not have the chaining logic of tower-web; but some kind of chaining should be possible, right?

(Been trying for a while ... keep failing at stuff not Cloneable or not the proper kind of Service :/ )

@hawkw hawkw added the question label Oct 8, 2018
@jakobdalsgaard
Copy link
Author

jakobdalsgaard commented Oct 20, 2018

I forked tower-grpc to try out a few ideas; I now have middleware support (a naive implementation...) for server side code generation here: https://github.com/jakobdalsgaard/tower-grpc -- I'll make an example too -- just need time.

The implementation merely wraps Service response types with middleware, and does nested constructor calls on service instantiation; doesn't seem perfect, but for now it works :-)

@micfan
Copy link

micfan commented Jun 16, 2019

need middleware +1

@LucioFranco
Copy link
Member

Here is an example of a tower middlware being applied to a grpc client. https://github.com/tower-rs/tower-grpc/blob/master/tower-grpc-examples/src/helloworld/client.rs#L29

@micfan
Copy link

micfan commented Jun 17, 2019

@LucioFranco Thank you, I'll check that example

update:
I mean that is there some kind of server side middleware register, like jakobdalsgaard@74476de implemented

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants