in dubbo/client.py [0:0]
def get_provider_host(self, interface):
"""
从zk中可以根据接口名称获取到此接口某个provider的host
:param interface:
:return:
"""
if interface not in self.hosts:
self.lock.acquire()
try:
if interface not in self.hosts:
path = DUBBO_ZK_PROVIDERS.format(interface)
if self.zk.exists(path):
self._get_providers_from_zk(path, interface)
self._get_configurators_from_zk(interface)
else:
raise RegisterException('No providers for interface {0}'.format(interface))
finally:
self.lock.release()
return self._routing_with_wight(interface)