funboost 47.5__py3-none-any.whl → 47.7__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.
- funboost/__init__.py +1 -1
- funboost/consumers/base_consumer.py +2 -1
- funboost/core/func_params_model.py +8 -1
- funboost/publishers/base_publisher.py +1 -1
- funboost/utils/class_utils.py +6 -6
- funboost/utils/dependency_packages_in_pythonpath/readme.md +7 -0
- funboost/utils/redis_manager.py +16 -16
- {funboost-47.5.dist-info → funboost-47.7.dist-info}/METADATA +596 -595
- {funboost-47.5.dist-info → funboost-47.7.dist-info}/RECORD +13 -13
- {funboost-47.5.dist-info → funboost-47.7.dist-info}/WHEEL +1 -1
- {funboost-47.5.dist-info → funboost-47.7.dist-info}/entry_points.txt +0 -1
- {funboost-47.5.dist-info → funboost-47.7.dist-info}/LICENSE +0 -0
- {funboost-47.5.dist-info → funboost-47.7.dist-info}/top_level.txt +0 -0
funboost/__init__.py
CHANGED
|
@@ -64,7 +64,8 @@ from funboost.concurrent_pool.async_pool_executor import AsyncPoolExecutor
|
|
|
64
64
|
from funboost.concurrent_pool.bounded_threadpoolexcutor import \
|
|
65
65
|
BoundedThreadPoolExecutor
|
|
66
66
|
from funboost.utils.redis_manager import RedisMixin
|
|
67
|
-
from func_timeout import func_set_timeout # noqa
|
|
67
|
+
# from func_timeout import func_set_timeout # noqa
|
|
68
|
+
from funboost.utils.func_timeout.dafunc import func_set_timeout
|
|
68
69
|
|
|
69
70
|
from funboost.concurrent_pool.custom_threadpool_executor import check_not_monkey
|
|
70
71
|
from funboost.concurrent_pool.flexible_thread_pool import FlexibleThreadPool, sync_or_async_fun_deco
|
|
@@ -205,7 +205,14 @@ class BoosterParams(BaseJsonAbleModel):
|
|
|
205
205
|
|
|
206
206
|
# func_params_is_pydantic_model: bool = False # funboost 兼容支持 函数娼还是 pydantic model类型,funboost在发布之前和取出来时候自己转化。
|
|
207
207
|
|
|
208
|
-
consuming_function_kind: typing.Optional[str] = None #
|
|
208
|
+
consuming_function_kind: typing.Optional[str] = None # 自动生成的信息,不需要用户主动传参,如果自动判断失误就传递。是判断消费函数是函数还是实例方法还是类方法。如果传递了,就不自动获取函数类型。
|
|
209
|
+
''' consuming_function_kind 可以为以下类型,
|
|
210
|
+
class FunctionKind:
|
|
211
|
+
CLASS_METHOD = 'CLASS_METHOD'
|
|
212
|
+
INSTANCE_METHOD = 'INSTANCE_METHOD'
|
|
213
|
+
STATIC_METHOD = 'STATIC_METHOD'
|
|
214
|
+
COMMON_FUNCTION = 'COMMON_FUNCTION'
|
|
215
|
+
'''
|
|
209
216
|
|
|
210
217
|
auto_generate_info: dict = {} # 自动生成的信息,不需要用户主动传参.
|
|
211
218
|
|
|
@@ -261,7 +261,7 @@ class AbstractPublisher(LoggerLevelSetterMixin, metaclass=abc.ABCMeta, ):
|
|
|
261
261
|
# print(func_args)
|
|
262
262
|
func_args_list = list(func_args)
|
|
263
263
|
|
|
264
|
-
print(func_args_list)
|
|
264
|
+
# print(func_args_list)
|
|
265
265
|
if self.publisher_params.consuming_function_kind == FunctionKind.CLASS_METHOD:
|
|
266
266
|
# print(self.publish_params_checker.all_arg_name[0])
|
|
267
267
|
# func_args_list.insert(0, {'first_param_name': self.publish_params_checker.all_arg_name[0],
|
funboost/utils/class_utils.py
CHANGED
|
@@ -14,17 +14,17 @@ from funboost.constant import FunctionKind
|
|
|
14
14
|
class ClsHelper:
|
|
15
15
|
@staticmethod
|
|
16
16
|
def get_instncae_method_cls(instncae_method):
|
|
17
|
-
print(instncae_method)
|
|
18
|
-
print(instncae_method.__qualname__)
|
|
19
|
-
print(instncae_method.__module__)
|
|
17
|
+
# print(instncae_method)
|
|
18
|
+
# print(instncae_method.__qualname__)
|
|
19
|
+
# print(instncae_method.__module__)
|
|
20
20
|
return getattr(sys.modules[instncae_method.__module__],instncae_method.__qualname__.split('.')[0])
|
|
21
21
|
# return instncae_method.__self__.__class__
|
|
22
22
|
|
|
23
23
|
@staticmethod
|
|
24
24
|
def get_classs_method_cls(class_method):
|
|
25
|
-
print(class_method)
|
|
26
|
-
print(class_method.__qualname__)
|
|
27
|
-
print(class_method.__module__)
|
|
25
|
+
# print(class_method)
|
|
26
|
+
# print(class_method.__qualname__)
|
|
27
|
+
# print(class_method.__module__)
|
|
28
28
|
return getattr(sys.modules[class_method.__module__],class_method.__qualname__.split('.')[0])
|
|
29
29
|
|
|
30
30
|
@staticmethod
|
funboost/utils/redis_manager.py
CHANGED
|
@@ -7,7 +7,7 @@ import redis5
|
|
|
7
7
|
from funboost.funboost_config_deafult import BrokerConnConfig
|
|
8
8
|
from funboost.utils import decorators
|
|
9
9
|
|
|
10
|
-
from aioredis.client import Redis as AioRedis
|
|
10
|
+
# from aioredis.client import Redis as AioRedis
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
@@ -40,21 +40,21 @@ class RedisManager(object):
|
|
|
40
40
|
return self.redis
|
|
41
41
|
|
|
42
42
|
|
|
43
|
-
class AioRedisManager(object):
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
43
|
+
# class AioRedisManager(object):
|
|
44
|
+
# _redis_db__conn_map = {}
|
|
45
|
+
#
|
|
46
|
+
# def __init__(self, host='127.0.0.1', port=6379, db=0, username='', password=''):
|
|
47
|
+
# self._key = (host, port, db, username, password,)
|
|
48
|
+
# if self._key not in self.__class__._redis_db__conn_map:
|
|
49
|
+
# self.__class__._redis_db__conn_map[self._key] = AioRedis(host=host, port=port, db=db, username=username,
|
|
50
|
+
# password=password, max_connections=1000, decode_responses=True)
|
|
51
|
+
# self.redis = self.__class__._redis_db__conn_map[self._key]
|
|
52
|
+
#
|
|
53
|
+
# def get_redis(self) -> AioRedis:
|
|
54
|
+
# """
|
|
55
|
+
# :rtype :redis5.Redis
|
|
56
|
+
# """
|
|
57
|
+
# return self.redis
|
|
58
58
|
|
|
59
59
|
|
|
60
60
|
# noinspection PyArgumentEqualDefault
|