How do I know that the message I am sending through an gRPC stream was received on the other end?
Is there a build in way to do that in gRPC bidirectional streaming or do I need to just use streaming and then send a response back?
Proto file:
service SimpleService {
rpc SimpleRPC (stream SimpleData) returns (stream SimpleData) {}
}
message SimpleData {
string msg = 1;
}
Go code:
client := pb.NewSimpleServiceClient(conn)
stream, err := client.SimpleRPC(context.Background())
waitc := make(chan struct{})
msg := &pb.SimpleData{"sup"}
go func() {
for {
stream.Send(msg)
}
}()
<-waitc
stream.CloseSend()