MCPcopy Index your code
hub / github.com/apache/dubbo-python2 / get

Method get

dubbo/connection/connections.py:40–70  ·  view source on GitHub ↗

执行远程调用获取数据 :param host: :param request_param: :param timeout: :return:

(self, host, request_param, timeout=None)

Source from the content-addressed store, hash-verified

38 scanning_thread.start()
39
40 def get(self, host, request_param, timeout=None):
41 """
42 执行远程调用获取数据
43 :param host:
44 :param request_param:
45 :param timeout:
46 :return:
47 """
48 conn = self._get_connection(host)
49 request = Request(request_param)
50 request_data = request.encode()
51 invoke_id = request.invoke_id
52
53 event = threading.Event()
54 self.conn_events[invoke_id] = event
55 # 发送数据
56 conn.write(request_data)
57 logger.debug('Waiting response, invoke_id={}, timeout={}, host={}'.format(invoke_id, timeout, host))
58 event.wait(timeout)
59 del self.conn_events[invoke_id]
60
61 if invoke_id not in self.results:
62 err = "Socket(host='{}'): Read timed out. (read timeout={})".format(host, timeout)
63 raise DubboRequestTimeoutException(err)
64
65 result = self.results.pop(invoke_id)
66 if isinstance(result, Exception):
67 logger.exception(result)
68 logger.error('Exception {} for host {}'.format(result, host))
69 raise result
70 return result
71
72 def _get_connection(self, host):
73 """

Callers 4

callMethod · 0.80
_watch_configuratorsMethod · 0.80
_routing_with_wightMethod · 0.80

Calls 6

_get_connectionMethod · 0.95
encodeMethod · 0.95
RequestClass · 0.90
writeMethod · 0.80
formatMethod · 0.80

Tested by

no test coverage detected