我创建了一个带有循环负载平衡策略的 grpc python 客户端
self.channel = grpc.insecure_channel(self.host,options=[("grpc.lb_policy_name",
"round_robin")])
将第一个参数作为主机传递,将第二个参数作为负载平衡策略传递。
self.blocking_stub = dict_pb2_grpc.ExampleServiceStub(self.channel)
也将通道传递给存根。
self.executor = concurrent.futures.ThreadPoolExecutor(
max_workers=self.thread_pool_size
)
到目前为止,我很清楚下一步是我想通过executor
自定义数量的线程。我怎样才能将 executor 传递给grpc.insecure_channel
?
我已经经历了(一些事情?),但没有找到与此相关的任何内容。