This is how I write similar APIs, with one caveat. I typically complete or close with CANCEL the connections randomly somewhere between 15-30 minutes after initial request to force my clients to handle reconnection. It also helps quite a bit with load balancing and deployments of new server code to know your clients are already coded to handle disconnections as a common occurrence.
William Thurston On Apr 26, 2017, at 12:44 AM, Kuldeep Melligeri <[email protected]> wrote: Hi, I am implementing a service where client is suppose to subscribe for some information on server. I am planning to implement with async streaming APIs. On server when it gets client request for the first time, the server starting writing back to client as and when the data is available from different source. To keep the RPC alive, I am only calling "write" whenever the data is available. I am planning to call finish only when server shuts down. Is this is the general practice for subscription based service? Or is there any better way to do this job? Thanks Kuldeep -- 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/dc37f9f3-7b7b-4f3c-b423-e628d68c8074%40googlegroups.com <https://groups.google.com/d/msgid/grpc-io/dc37f9f3-7b7b-4f3c-b423-e628d68c8074%40googlegroups.com?utm_medium=email&utm_source=footer> . For more options, visit https://groups.google.com/d/optout. -- 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/-4267138126484448606%40unknownmsgid. For more options, visit https://groups.google.com/d/optout.
