I have a bi-directional RPC, let's use the sample StreamingGreeter
<https://github.com/grpc/grpc-java/blob/master/examples/src/main/proto/hello_streaming.proto>
.
I need to register a response observer:
// a response observer
StreamObserver<HelloReply> responseObserver = new StreamObserver<HelloReply
>() { ... };
StreamingGreeterGrpc.StreamingGreeterStub stub = StreamingGreeterGrpc.
newStub(channel);
// calling the streaming rpc returns the request observer
StreamObserver<HelloRequest> requestObserver = stub.SayHelloStreaming(
responseObserver);
So, how do I safely use the request observer from within the response
observer, given that the response observer has to be created before the rpc
call and the request observer is only available after the rpc call?
In my example, upon receiving HelloReply, I might want to, for example
trigger sending another HelloRequest (for whatever reason).
--
You received this message because you are subscribed to the Google Groups
"grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/grpc-io.
To view this discussion on the web visit
https://groups.google.com/d/msgid/grpc-io/2a232c67-14d9-4700-9b35-47cababb7c22%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.