funboost 19.5__py3-none-any.whl → 19.6__py3-none-any.whl

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.

Potentially problematic release.


This version of funboost might be problematic. Click here for more details.

Files changed (42) hide show
  1. funboost/__init__.py +0 -1
  2. funboost/consumers/base_consumer.py +4 -6
  3. funboost/utils/dependency_packages_in_pythonpath/__pycache__/add_to_pythonpath.cpython-311.pyc +0 -0
  4. funboost/utils/dependency_packages_in_pythonpath/__pycache__/add_to_pythonpath.cpython-37.pyc +0 -0
  5. funboost/utils/dependency_packages_in_pythonpath/add_to_pythonpath.py +1 -1
  6. funboost/utils/dependency_packages_in_pythonpath/aioredis/__init__.py +59 -0
  7. funboost/utils/dependency_packages_in_pythonpath/aioredis/__pycache__/__init__.cpython-311.pyc +0 -0
  8. funboost/utils/dependency_packages_in_pythonpath/aioredis/__pycache__/__init__.cpython-37.pyc +0 -0
  9. funboost/utils/dependency_packages_in_pythonpath/aioredis/__pycache__/client.cpython-311.pyc +0 -0
  10. funboost/utils/dependency_packages_in_pythonpath/aioredis/__pycache__/client.cpython-37.pyc +0 -0
  11. funboost/utils/dependency_packages_in_pythonpath/aioredis/__pycache__/compat.cpython-311.pyc +0 -0
  12. funboost/utils/dependency_packages_in_pythonpath/aioredis/__pycache__/compat.cpython-37.pyc +0 -0
  13. funboost/utils/dependency_packages_in_pythonpath/aioredis/__pycache__/connection.cpython-311.pyc +0 -0
  14. funboost/utils/dependency_packages_in_pythonpath/aioredis/__pycache__/connection.cpython-37.pyc +0 -0
  15. funboost/utils/dependency_packages_in_pythonpath/aioredis/__pycache__/exceptions.cpython-311.pyc +0 -0
  16. funboost/utils/dependency_packages_in_pythonpath/aioredis/__pycache__/exceptions.cpython-37.pyc +0 -0
  17. funboost/utils/dependency_packages_in_pythonpath/aioredis/__pycache__/lock.cpython-311.pyc +0 -0
  18. funboost/utils/dependency_packages_in_pythonpath/aioredis/__pycache__/lock.cpython-37.pyc +0 -0
  19. funboost/utils/dependency_packages_in_pythonpath/aioredis/__pycache__/utils.cpython-311.pyc +0 -0
  20. funboost/utils/dependency_packages_in_pythonpath/aioredis/__pycache__/utils.cpython-37.pyc +0 -0
  21. funboost/utils/dependency_packages_in_pythonpath/aioredis/client.py +4804 -0
  22. funboost/utils/dependency_packages_in_pythonpath/aioredis/compat.py +8 -0
  23. funboost/utils/dependency_packages_in_pythonpath/aioredis/connection.py +1668 -0
  24. funboost/utils/dependency_packages_in_pythonpath/aioredis/exceptions.py +96 -0
  25. funboost/utils/dependency_packages_in_pythonpath/aioredis/lock.py +306 -0
  26. funboost/utils/dependency_packages_in_pythonpath/aioredis/log.py +15 -0
  27. funboost/utils/dependency_packages_in_pythonpath/aioredis/py.typed +0 -0
  28. funboost/utils/dependency_packages_in_pythonpath/aioredis/readme.md +20 -0
  29. funboost/utils/dependency_packages_in_pythonpath/aioredis/sentinel.py +329 -0
  30. funboost/utils/dependency_packages_in_pythonpath/aioredis/utils.py +61 -0
  31. funboost/utils/dependency_packages_in_pythonpath/func_timeout/__pycache__/StoppableThread.cpython-37.pyc +0 -0
  32. funboost/utils/dependency_packages_in_pythonpath/func_timeout/__pycache__/__init__.cpython-37.pyc +0 -0
  33. funboost/utils/dependency_packages_in_pythonpath/func_timeout/__pycache__/dafunc.cpython-37.pyc +0 -0
  34. funboost/utils/dependency_packages_in_pythonpath/func_timeout/__pycache__/exceptions.cpython-37.pyc +0 -0
  35. funboost/utils/dependency_packages_in_pythonpath/func_timeout/__pycache__/py3_raise.cpython-37.pyc +0 -0
  36. funboost/utils/dependency_packages_in_pythonpath/readme.md +14 -0
  37. funboost/utils/redis_manager.py +1 -1
  38. {funboost-19.5.dist-info → funboost-19.6.dist-info}/METADATA +424 -423
  39. {funboost-19.5.dist-info → funboost-19.6.dist-info}/RECORD +42 -11
  40. {funboost-19.5.dist-info → funboost-19.6.dist-info}/WHEEL +5 -5
  41. {funboost-19.5.dist-info → funboost-19.6.dist-info}/LICENSE +0 -0
  42. {funboost-19.5.dist-info → funboost-19.6.dist-info}/top_level.txt +0 -0
funboost/__init__.py CHANGED
@@ -1,4 +1,3 @@
1
-
2
1
  # noinspection PyUnresolvedReferences
3
2
  from funboost.utils.dependency_packages_in_pythonpath import add_to_pythonpath
4
3
 
@@ -52,7 +52,7 @@ from funboost.concurrent_pool.async_pool_executor import AsyncPoolExecutor
52
52
  # noinspection PyUnresolvedReferences
53
53
  from funboost.concurrent_pool.bounded_threadpoolexcutor import \
54
54
  BoundedThreadPoolExecutor
55
- from func_timeout import func_set_timeout # noqa
55
+ from func_timeout import func_set_timeout # noqa
56
56
  from funboost.concurrent_pool.custom_evenlet_pool_executor import evenlet_timeout_deco, \
57
57
  check_evenlet_monkey_patch, CustomEventletPoolExecutor
58
58
  from funboost.concurrent_pool.custom_gevent_pool_executor import gevent_timeout_deco, \
@@ -747,8 +747,7 @@ class AbstractConsumer(LoggerLevelSetterMixin, metaclass=abc.ABCMeta, ):
747
747
  f'第{current_retry_times + 1}次 运行, 正确了,函数运行时间是 {round(time.time() - t_start, 4)} 秒,入参是 {function_only_params} '
748
748
  f' 结果是 {result_str_to_be_print} , {self._get_concurrent_info()} ')
749
749
  except BaseException as e:
750
- if isinstance(e, (PyMongoError,
751
- ExceptionForRequeue)): # mongo经常维护备份时候插入不了或挂了,或者自己主动抛出一个ExceptionForRequeue类型的错误会重新入队,不受指定重试次数逇约束。
750
+ if isinstance(e, (ExceptionForRequeue,)): # mongo经常维护备份时候插入不了或挂了,或者自己主动抛出一个ExceptionForRequeue类型的错误会重新入队,不受指定重试次数逇约束。
752
751
  self.logger.critical(f'函数 [{self.consuming_function.__name__}] 中发生错误 {type(e)} {e},消息重新入队')
753
752
  time.sleep(1) # 防止快速无限出错入队出队,导致cpu和中间件忙
754
753
  self._requeue(kw)
@@ -851,8 +850,7 @@ class AbstractConsumer(LoggerLevelSetterMixin, metaclass=abc.ABCMeta, ):
851
850
  f'第{current_retry_times + 1}次 运行, 正确了,函数运行时间是 {round(time.time() - t_start, 4)} 秒,'
852
851
  f'入参是 【 {function_only_params} 】 ,结果是 {result_str_to_be_print} 。 {corotinue_obj} ')
853
852
  except BaseException as e:
854
- if isinstance(e, (PyMongoError,
855
- ExceptionForRequeue)): # mongo经常维护备份时候插入不了或挂了,或者自己主动抛出一个ExceptionForRequeue类型的错误会重新入队,不受指定重试次数逇约束。
853
+ if isinstance(e, (ExceptionForRequeue,)): # mongo经常维护备份时候插入不了或挂了,或者自己主动抛出一个ExceptionForRequeue类型的错误会重新入队,不受指定重试次数逇约束。
856
854
  self.logger.critical(f'函数 [{self.consuming_function.__name__}] 中发生错误 {type(e)} {e},消息重新入队')
857
855
  # time.sleep(1) # 防止快速无限出错入队出队,导致cpu和中间件忙
858
856
  await asyncio.sleep(1)
@@ -1057,7 +1055,7 @@ class ConcurrentModeDispatcher(LoggerMixin):
1057
1055
  self.timeout_deco = None
1058
1056
  if self._concurrent_mode in (ConcurrentModeEnum.THREADING, ConcurrentModeEnum.SINGLE_THREAD):
1059
1057
  # self.timeout_deco = decorators.timeout
1060
- self.timeout_deco = func_set_timeout # 这个超时装饰器性能好很多。
1058
+ self.timeout_deco = func_set_timeout # 这个超时装饰器性能好很多。
1061
1059
  elif self._concurrent_mode == ConcurrentModeEnum.GEVENT:
1062
1060
  self.timeout_deco = gevent_timeout_deco
1063
1061
  elif self._concurrent_mode == ConcurrentModeEnum.EVENTLET:
@@ -3,5 +3,5 @@ from pathlib import Path
3
3
 
4
4
  current_dir = str(Path(__file__).parent)
5
5
 
6
- sys.path.insert(4, current_dir)
6
+ sys.path.insert(4, current_dir) # 这样做是为了提高这里的优先级,例如用户自己安装了aioredis包,但是运行funboost时候,这个文件夹的aioredis包会优先被导入,比sys.path.append好。
7
7
  # sys.path.append(current_dir)
@@ -0,0 +1,59 @@
1
+ from aioredis.client import Redis, StrictRedis
2
+ from aioredis.connection import (
3
+ BlockingConnectionPool,
4
+ Connection,
5
+ ConnectionPool,
6
+ SSLConnection,
7
+ UnixDomainSocketConnection,
8
+ )
9
+ from aioredis.exceptions import (
10
+ AuthenticationError,
11
+ AuthenticationWrongNumberOfArgsError,
12
+ BusyLoadingError,
13
+ ChildDeadlockedError,
14
+ ConnectionError,
15
+ DataError,
16
+ InvalidResponse,
17
+ PubSubError,
18
+ ReadOnlyError,
19
+ RedisError,
20
+ ResponseError,
21
+ TimeoutError,
22
+ WatchError,
23
+ )
24
+ from aioredis.utils import from_url
25
+
26
+
27
+ def int_or_str(value):
28
+ try:
29
+ return int(value)
30
+ except ValueError:
31
+ return value
32
+
33
+
34
+ __version__ = "2.0.1"
35
+ VERSION = tuple(map(int_or_str, __version__.split(".")))
36
+
37
+ __all__ = [
38
+ "AuthenticationError",
39
+ "AuthenticationWrongNumberOfArgsError",
40
+ "BlockingConnectionPool",
41
+ "BusyLoadingError",
42
+ "ChildDeadlockedError",
43
+ "Connection",
44
+ "ConnectionError",
45
+ "ConnectionPool",
46
+ "DataError",
47
+ "from_url",
48
+ "InvalidResponse",
49
+ "PubSubError",
50
+ "ReadOnlyError",
51
+ "Redis",
52
+ "RedisError",
53
+ "ResponseError",
54
+ "SSLConnection",
55
+ "StrictRedis",
56
+ "TimeoutError",
57
+ "UnixDomainSocketConnection",
58
+ "WatchError",
59
+ ]