Examples using tower-grpc with middleware
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 :/ )
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 :-)
need middleware +1
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
@LucioFranco Thank you, I'll check that example
update: I mean that is there some kind of server side middleware register, like https://github.com/jakobdalsgaard/tower-grpc/commit/74476dedc2f51167c0962acc2a06ed954eaa5e02 implemented