14 """The Python AsyncIO implementation of the gRPC client-side retry example."""
22 helloworld_pb2, helloworld_pb2_grpc = grpc.protos_and_services(
26 async
def run() -> None:
29 service_config_json = json.dumps({
33 "service":
"helloworld.Greeter",
38 "initialBackoff":
"0.1s",
40 "backoffMultiplier": 2,
41 "retryableStatusCodes": [
"UNAVAILABLE"],
47 options.append((
"grpc.enable_retries", 1))
48 options.append((
"grpc.service_config", service_config_json))
49 async
with grpc.aio.insecure_channel(
'localhost:50051',
50 options=options)
as channel:
53 print(
"Greeter client received: " + response.message)
56 if __name__ ==
'__main__':