Skip to content

liut/grpc-retry-py

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Retry call of gRPC stub

The implement of code inspiration from google-cloud-python#2583

Tested OK with grpcio==1.3.0

from grpc_retry import retrying_stub_methods

channel = grpc.insecure_channel('localhost:50051')
stub = helloworld_pb2_grpc.GreeterStub(channel)

# os.setenv('GRPC_RETRY_UNAVAILABLE', 5)
# os.setenv('GRPC_RETRY_DEADLINE_EXCEEDED', 4)
retrying_stub_methods(stub)

response = stub.SayHello(helloworld_pb2.HelloRequest(name='you'))
print("Greeter client received: " + response.message)

Releases

No releases published

Packages

No packages published