MCPcopy Create free account
hub / github.com/apache/dubbo-python2 / _get_connection

Method _get_connection

dubbo/connection/connections.py:72–88  ·  view source on GitHub ↗

通过host获取到与此host相关的socket,本地会对socket进行缓存 :param host: :return:

(self, host)

Source from the content-addressed store, hash-verified

70 return result
71
72 def _get_connection(self, host):
73 """
74 通过host获取到与此host相关的socket,本地会对socket进行缓存
75 :param host:
76 :return:
77 """
78 if not host or ':' not in host:
79 raise ValueError('invalid host {}'.format(host))
80 if host not in self._connection_pool:
81 self.conn_lock.acquire()
82 try:
83 if host not in self._connection_pool:
84 self.client_heartbeats[host] = 0
85 self._new_connection(host)
86 finally:
87 self.conn_lock.release()
88 return self._connection_pool[host]
89
90 def _new_connection(self, host):
91 """

Callers 1

getMethod · 0.95

Calls 2

_new_connectionMethod · 0.95
formatMethod · 0.80

Tested by

no test coverage detected