> On 23 Jul 2021, at 2:29 am, 'dfa...@google.com' via grpc.io 
> <grpc-io@googlegroups.com> wrote:
> 
> 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.

Thank you.

Here’s an implementation: 
https://gist.github.com/amitsaha/cbc74fa75f089dee5df495c7531d16db 
<https://gist.github.com/amitsaha/cbc74fa75f089dee5df495c7531d16db> - will 
hopefully be useful to somebody else.

> 
> -- 
> 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 
> <mailto: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
>  
> <https://groups.google.com/d/msgid/grpc-io/cb6cfcfd-342f-42a1-9ed0-f976d918802bn%40googlegroups.com?utm_medium=email&utm_source=footer>.

-- 
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/59F7E455-93B8-44DF-A80B-96BBAB3AAE34%40gmail.com.

Reply via email to