client side load balancing in grpc python

Viewed 95

I am new to python and was trying to implement client side load balancing in gRPC. I know how to do it in Java but not able to find appropriate document describing how to do the same in python, below is my Java code.

NameResolver.Factory nameResolverFactory = new MultiAddressNameResolverFactory(
            new InetSocketAddress("localhost", 10000),
            new InetSocketAddress("localhost", 10001),
            new InetSocketAddress("localhost", 10002)
    );

ManagedChannel channel = ManagedChannelBuilder.forTarget("service")
            .nameResolverFactory(nameResolverFactory)
            .defaultLoadBalancingPolicy("round_robin")
            .usePlaintext()
            .build();

In python I know how to connect to one server but not a list of gRPC servers

channel = grpc.insecure_channel('localhost:10000')

can anyone kindly guide me or point me to a document on how to implement the same?

0 Answers
Related