How to shutdown a gRPC Node client cleanly

534 views
Skip to first unread message

jdov...@gmail.com

unread,
Jul 26, 2016, 6:38:28 PM7/26/16
to grpc.io
I noticed in the supplied examples that the Java clients have a way of cleanly closing the connection w/o creating server exceptions.

This is what it looks like (from the HelloWorldClient.java example):

   public void shutdown() throws InterruptedException {
      channel.shutdown().awaitTermination(5, TimeUnit.SECONDS);
   }

What's the equivalent for Node?

I noticed that premature termination of Node clients will cause exceptions on Java servers.

Michael Lumish

unread,
Jul 26, 2016, 6:49:14 PM7/26/16
to jdov...@gmail.com, grpc.io
Node clients currently do not have an explicit shutdown method. Just drop any references to the client, and it will close when it gets garbage collected.

--
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+u...@googlegroups.com.
To post to this group, send email to grp...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/grpc-io/804babcb-0051-4775-a8f9-5a902d38394a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages