[docs]defget_server()->grpc.aio.Server:server=grpc.aio.server()hello_pb2_grpc.add_GreeterServicer_to_server(Greeter(),server)listen_addr="[::]:50051"server.add_insecure_port(listen_addr)logging.info("Starting server on %s",listen_addr)returnserver
[docs]asyncdefserve()->None:# pragma no coverserver=get_server()awaitserver.start()awaitserver.wait_for_termination()
if__name__=="__main__":# pragma no coverlogging.basicConfig(level=logging.INFO)asyncio.run(serve())