I am working on an architecture with a single client and multiple servers. 
GRPC raises an exception if the client starts without a server present, so 
I tried modifying the HelloWorld sample to wait until a call succeeds:

  done = False
  while not done:
      try:
          response = stub.SayHello(helloworld_pb2.HelloRequest(name='you'), 
timeout=1)
          print("Greeter client received: " + response.message)
          done = True
      except:
          print('Waiting for server connect...')
          time.sleep(1)


Strangely, though this works, it takes quite a while to connect when the 
server is started after the client (about 10 seconds or more) before 
showing the result. A quick internet search shows there is a WaitForReady 
option in C#, but there doesn't seem to be an equivalent in Python? How 
else can I check if a connection is ready?


    

-- 
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/a2f41bce-007a-4adb-8032-1ea3af6c5100%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to