Hi,
Our client application and our server will continuously exchange messages:
- Client may send a message containing a gps coordinate every 10 seconds to the server
- Server may send a message containing geolocalized information
- If there is nothing close the client gps position, server sends nothing
- If an incoming information appears close the client gps position, server push a message to the client
We plan to define our service like this:
service Information
rpc GetInformation(stream ClientPosition) returns (stream GeoInformation);
}
From an implementation point of view, client and server will keep sending and receiving message forever.
They won't call grpc::ClientReaderWriter::WritesDone at any time, or may be only if grpc::ClientReaderWriter::Write or grpc::ClientReaderWriter::Read return false.
We didn't see any such use case in
C++ examples in the github gRPC repository. Stream based examples assumes that client or server will write a sequence of messages, indicate the sequence is finished, then read a sequence as a response. done.
Is a never ending bidirectionnal stream a valid usage of gRPC ?
Thank you,
David