Does the client streaming happen independent of server streaming? #1131
-
Tonic wraps the client streaming into I am wondering whether the client streaming is independent of server streaming (or single response retrieval)? In grpc spec, it should be independent. But how about toinc? BTW, IMO, wrapping the client streaming into |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
In the example you showed it is a stream built from an iterator there is no async work going on. You can pass in anystream you like so you could pass in the https://docs.rs/tokio-stream/latest/tokio_stream/wrappers/struct.ReceiverStream.html type and you can then use a channel to achieve the same thing go has. This implementation is much more flexible than the go one its just the example is showing a simple use case here. |
Beta Was this translation helpful? Give feedback.
-
Thanks for @LucioFranco and @davidpdrsn. BTW, here is my blog post about how to implement grpc client library for openresty/Nginx using tonic: |
Beta Was this translation helpful? Give feedback.
In the example you showed it is a stream built from an iterator there is no async work going on. You can pass in anystream you like so you could pass in the https://docs.rs/tokio-stream/latest/tokio_stream/wrappers/struct.ReceiverStream.html type and you can then use a channel to achieve the same thing go has. This implementation is much more flexible than the go one its just the example is showing a simple use case here.