dubbo-ssl-python 0.9.5__tar.gz → 0.9.6__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (22) hide show
  1. {dubbo_ssl_python-0.9.5 → dubbo_ssl_python-0.9.6}/PKG-INFO +1 -2
  2. {dubbo_ssl_python-0.9.5 → dubbo_ssl_python-0.9.6}/dubbo_ssl/__init__.py +1 -1
  3. {dubbo_ssl_python-0.9.5 → dubbo_ssl_python-0.9.6}/dubbo_ssl/client.py +11 -11
  4. {dubbo_ssl_python-0.9.5 → dubbo_ssl_python-0.9.6}/dubbo_ssl_python.egg-info/PKG-INFO +1 -2
  5. {dubbo_ssl_python-0.9.5 → dubbo_ssl_python-0.9.6}/pyproject.toml +2 -3
  6. {dubbo_ssl_python-0.9.5 → dubbo_ssl_python-0.9.6}/LICENSE +0 -0
  7. {dubbo_ssl_python-0.9.5 → dubbo_ssl_python-0.9.6}/README.md +0 -0
  8. {dubbo_ssl_python-0.9.5 → dubbo_ssl_python-0.9.6}/dubbo_ssl/codec/__init__.py +0 -0
  9. {dubbo_ssl_python-0.9.5 → dubbo_ssl_python-0.9.6}/dubbo_ssl/codec/decoder.py +0 -0
  10. {dubbo_ssl_python-0.9.5 → dubbo_ssl_python-0.9.6}/dubbo_ssl/codec/encoder.py +0 -0
  11. {dubbo_ssl_python-0.9.5 → dubbo_ssl_python-0.9.6}/dubbo_ssl/common/__init__.py +0 -0
  12. {dubbo_ssl_python-0.9.5 → dubbo_ssl_python-0.9.6}/dubbo_ssl/common/constants.py +0 -0
  13. {dubbo_ssl_python-0.9.5 → dubbo_ssl_python-0.9.6}/dubbo_ssl/common/exceptions.py +0 -0
  14. {dubbo_ssl_python-0.9.5 → dubbo_ssl_python-0.9.6}/dubbo_ssl/common/util.py +0 -0
  15. {dubbo_ssl_python-0.9.5 → dubbo_ssl_python-0.9.6}/dubbo_ssl/connection/__init__.py +0 -0
  16. {dubbo_ssl_python-0.9.5 → dubbo_ssl_python-0.9.6}/dubbo_ssl/connection/connections.py +0 -0
  17. {dubbo_ssl_python-0.9.5 → dubbo_ssl_python-0.9.6}/dubbo_ssl_python.egg-info/SOURCES.txt +0 -0
  18. {dubbo_ssl_python-0.9.5 → dubbo_ssl_python-0.9.6}/dubbo_ssl_python.egg-info/dependency_links.txt +0 -0
  19. {dubbo_ssl_python-0.9.5 → dubbo_ssl_python-0.9.6}/dubbo_ssl_python.egg-info/requires.txt +0 -0
  20. {dubbo_ssl_python-0.9.5 → dubbo_ssl_python-0.9.6}/dubbo_ssl_python.egg-info/top_level.txt +0 -0
  21. {dubbo_ssl_python-0.9.5 → dubbo_ssl_python-0.9.6}/setup.cfg +0 -0
  22. {dubbo_ssl_python-0.9.5 → dubbo_ssl_python-0.9.6}/tests/test_client.py +0 -0
@@ -1,9 +1,8 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dubbo-ssl-python
3
- Version: 0.9.5
3
+ Version: 0.9.6
4
4
  Summary: Python client for Apache Dubbo RPC protocol, with Hessian2 serialization and SSL/TLS support.
5
5
  Author-email: gigi wang <gigiwgoo@gmail.com>
6
- License-Expression: Apache-2.0
7
6
  Project-URL: Homepage, https://iocoo.github.io
8
7
  Project-URL: Repository, https://github.com/iocoo/dubbo-ssl-python/
9
8
  Keywords: dubbo
@@ -1,2 +1,2 @@
1
1
  # -*- coding: utf-8 -*-
2
- __version__ = "0.9.0"
2
+ __version__ = "0.9.6"
@@ -146,7 +146,7 @@ class ZkRegister(object):
146
146
 
147
147
  self._raw_providers[interface] = dubbo_providers
148
148
  self._refresh_host_cache(interface)
149
- logger.debug('interfaces: {} raw_providers updated,count:{}'.format(interface, len(dubbo_providers)))
149
+ logger.debug('interface: {} raw_providers updated,count:{}'.format(interface, len(dubbo_providers)))
150
150
 
151
151
  def _clear_hosts_for_interface(self,interface):
152
152
  """清空指定interface 下的缓存"""
@@ -189,7 +189,7 @@ class ZkRegister(object):
189
189
  raise RegisterException('No providers for interface {0}'.format(interface))
190
190
  finally:
191
191
  self.lock.release()
192
- return self._routing_with_wight(cache_key)
192
+ return self._routing_with_weight(cache_key)
193
193
 
194
194
  def _get_providers_from_zk(self, path, interface, version, group):
195
195
  """
@@ -218,7 +218,7 @@ class ZkRegister(object):
218
218
  with self._interface_lock:
219
219
  self._subscribed_interfaces.add(interface)
220
220
 
221
- def _get_configurats_from_zk(self, interface):
221
+ def _get_configurators_from_zk(self, interface):
222
222
  """
223
223
  试图从配置中取出权重相关的信息
224
224
  :param interface:
@@ -229,7 +229,7 @@ class ZkRegister(object):
229
229
  configurators = list(map(parse_url, configurators))
230
230
  conf = {}
231
231
  for configurator in configurators:
232
- conf[configurator['host']] = configurator['fields'].get('weight', 100) # 默认100
232
+ conf[configurator['host']] = int(configurator['fields'].get('weight', 100)) # 默认100
233
233
  self.weights[interface] = conf
234
234
 
235
235
  def _watch_configurators(self, event):
@@ -292,24 +292,24 @@ class ZkRegister(object):
292
292
  self.zk.ensure_path(consumer_path)
293
293
  self.zk.create_async(consumer_path + '/' + quote(consumer, safe=''), ephemeral=True)
294
294
 
295
- def _routing_with_wight(self, cached_key):
295
+ def _routing_with_weight(self, cache_key):
296
296
  """
297
297
  根据接口名称以及配置好的权重信息获取一个host
298
- :param cached_key:
298
+ :param cache_key:
299
299
  :return:
300
300
  """
301
- hosts = self.hosts.get(cached_key,[])
301
+ hosts = self.hosts.get(cache_key,[])
302
302
  if not hosts:
303
- raise RegisterException('no providers for {}'.format(cached_key))
303
+ raise RegisterException('no providers for {}'.format(cache_key))
304
304
  # 此接口没有权重设置,使用朴素的路由算法
305
- interface = cached_key[0]
305
+ interface = cache_key[0]
306
306
  if interface not in self.weights or not self.weights[interface]:
307
307
  return random.choice(hosts)
308
308
 
309
309
  weights = self.weights[interface]
310
- weighted_hosts = [(hosts, int(weights.get(host,100))) for host in hosts if int(weights.get(host,100)) >0 ]
310
+ weighted_hosts = [(host, int(weights.get(host,100))) for host in hosts if int(weights.get(host,100)) >0 ]
311
311
  if not weighted_hosts:
312
- raise RegisterException('no available providers for [{}] (all weight are 0).'.format(cached_key))
312
+ raise RegisterException('no available providers for [{}] (all weights are 0).'.format(cache_key))
313
313
 
314
314
  hosts_list,hosts_weight = zip(*weighted_hosts)
315
315
  total = sum(hosts_weight)
@@ -1,9 +1,8 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dubbo-ssl-python
3
- Version: 0.9.5
3
+ Version: 0.9.6
4
4
  Summary: Python client for Apache Dubbo RPC protocol, with Hessian2 serialization and SSL/TLS support.
5
5
  Author-email: gigi wang <gigiwgoo@gmail.com>
6
- License-Expression: Apache-2.0
7
6
  Project-URL: Homepage, https://iocoo.github.io
8
7
  Project-URL: Repository, https://github.com/iocoo/dubbo-ssl-python/
9
8
  Keywords: dubbo
@@ -4,15 +4,14 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "dubbo-ssl-python"
7
- version = "0.9.5"
7
+ version = "0.9.6"
8
8
  keywords = ["dubbo"]
9
9
  authors = [
10
10
  { name="gigi wang", email="gigiwgoo@gmail.com" }
11
11
  ]
12
12
  description = "Python client for Apache Dubbo RPC protocol, with Hessian2 serialization and SSL/TLS support."
13
13
  readme = "README.md"
14
-
15
- license = "Apache-2.0"
14
+ license-files = [ "LICENSE" ]
16
15
  dependencies = [
17
16
  "kazoo>=2.8.0",
18
17
  ]