相关疑难解决方法(0)

如何知道GRPC服务器是否可用

If a gRPC client starts before the server, it exits with an exception. The application I am working on starts a bunch of servers and clients (near) simultaneously, however, and I have to be robust with respect to execution order. If the client starts before the server, I want it to wait until the server shows up.

I modified the HelloWorld python client example as follows:

done = False
while not done:
    try:
        response = stub.SayHello(helloworld_pb2.HelloRequest(name='you'), timeout=1)
        print("Greeter client received: …
Run Code Online (Sandbox Code Playgroud)

python linux grpc

0
推荐指数
2
解决办法
3461
查看次数

标签 统计

grpc ×1

linux ×1

python ×1