On Wednesday, July 14, 2021 at 3:53:40 PM UTC-7 amits...@gmail.com wrote: > Thanks, I am able to understand what you are proposing. With this > approach, when I try to Send() with the stream disconnected, then the > operation will either exit - which is not what I want, or wait for the > recv() call to signal it to recreate the stream. I must then > write my code in a way that the Send() method has some way of > preserving the message that it failed to send and then when it gets a > signal from recv() to recreate the stream, it can then send it. > > Did I get that right?
That's almost exactly what I meant. One difference: in my suggestion, I had the Recv goroutine recreating the thread, which seems simpler since it's Recv that determines whether it needs to recreate it based on the error. In that design, you'd probably push the stream object itself to the Send goroutine via a channel, or close the channel if the stream is not being recreated. -- 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 grpc-io+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/grpc-io/cb6cfcfd-342f-42a1-9ed0-f976d918802bn%40googlegroups.com.