提交 7f4f224a 编写于 作者: B barrierye

support endpoints

上级 412986ef
......@@ -16,7 +16,7 @@ import numpy as np
from line_profiler import LineProfiler
client = PipelineClient()
client.connect('localhost:8080')
client.connect(['127.0.0.1:8080'])
lp = LineProfiler()
lp_wrapper = lp(client.predict)
......
......@@ -27,8 +27,12 @@ class PipelineClient(object):
def __init__(self):
self._channel = None
def connect(self, endpoint):
self._channel = grpc.insecure_channel(endpoint)
def connect(self, endpoints):
options = [('grpc.max_receive_message_length', 512 * 1024 * 1024),
('grpc.max_send_message_length', 512 * 1024 * 1024),
('grpc.lb_policy_name', 'round_robin')]
g_endpoint = 'ipv4:{}'.format(','.join(endpoints))
self._channel = grpc.insecure_channel(g_endpoint, options=options)
self._stub = pipeline_service_pb2_grpc.PipelineServiceStub(
self._channel)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册