funboost 44.7__py3-none-any.whl → 44.8__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 +8 -2
- funboost/core/current_task.py +1 -1
- funboost/core/func_params_model.py +15 -0
- funboost/core/lazy_impoter.py +8 -2
- funboost/function_result_web/__pycache__/app.cpython-37.pyc +0 -0
- funboost/function_result_web/__pycache__/functions.cpython-37.pyc +0 -0
- funboost/utils/dependency_packages_in_pythonpath/__pycache__/__init__.cpython-311.pyc +0 -0
- funboost/utils/dependency_packages_in_pythonpath/__pycache__/__init__.cpython-37.pyc +0 -0
- funboost/utils/dependency_packages_in_pythonpath/__pycache__/__init__.cpython-39.pyc +0 -0
- funboost/utils/dependency_packages_in_pythonpath/__pycache__/add_to_pythonpath.cpython-311.pyc +0 -0
- funboost/utils/dependency_packages_in_pythonpath/__pycache__/add_to_pythonpath.cpython-37.pyc +0 -0
- funboost/utils/dependency_packages_in_pythonpath/__pycache__/add_to_pythonpath.cpython-39.pyc +0 -0
- funboost/utils/dependency_packages_in_pythonpath/aioredis/__init__.py +59 -59
- funboost/utils/dependency_packages_in_pythonpath/aioredis/__pycache__/__init__.cpython-311.pyc +0 -0
- funboost/utils/dependency_packages_in_pythonpath/aioredis/__pycache__/__init__.cpython-37.pyc +0 -0
- funboost/utils/dependency_packages_in_pythonpath/aioredis/__pycache__/__init__.cpython-39.pyc +0 -0
- funboost/utils/dependency_packages_in_pythonpath/aioredis/__pycache__/client.cpython-311.pyc +0 -0
- funboost/utils/dependency_packages_in_pythonpath/aioredis/__pycache__/client.cpython-37.pyc +0 -0
- funboost/utils/dependency_packages_in_pythonpath/aioredis/__pycache__/client.cpython-39.pyc +0 -0
- funboost/utils/dependency_packages_in_pythonpath/aioredis/__pycache__/compat.cpython-311.pyc +0 -0
- funboost/utils/dependency_packages_in_pythonpath/aioredis/__pycache__/compat.cpython-37.pyc +0 -0
- funboost/utils/dependency_packages_in_pythonpath/aioredis/__pycache__/compat.cpython-39.pyc +0 -0
- funboost/utils/dependency_packages_in_pythonpath/aioredis/__pycache__/connection.cpython-311.pyc +0 -0
- funboost/utils/dependency_packages_in_pythonpath/aioredis/__pycache__/connection.cpython-37.pyc +0 -0
- funboost/utils/dependency_packages_in_pythonpath/aioredis/__pycache__/connection.cpython-39.pyc +0 -0
- funboost/utils/dependency_packages_in_pythonpath/aioredis/__pycache__/exceptions.cpython-311.pyc +0 -0
- funboost/utils/dependency_packages_in_pythonpath/aioredis/__pycache__/exceptions.cpython-37.pyc +0 -0
- funboost/utils/dependency_packages_in_pythonpath/aioredis/__pycache__/exceptions.cpython-39.pyc +0 -0
- funboost/utils/dependency_packages_in_pythonpath/aioredis/__pycache__/lock.cpython-311.pyc +0 -0
- funboost/utils/dependency_packages_in_pythonpath/aioredis/__pycache__/lock.cpython-37.pyc +0 -0
- funboost/utils/dependency_packages_in_pythonpath/aioredis/__pycache__/lock.cpython-39.pyc +0 -0
- funboost/utils/dependency_packages_in_pythonpath/aioredis/__pycache__/utils.cpython-311.pyc +0 -0
- funboost/utils/dependency_packages_in_pythonpath/aioredis/__pycache__/utils.cpython-37.pyc +0 -0
- funboost/utils/dependency_packages_in_pythonpath/aioredis/__pycache__/utils.cpython-39.pyc +0 -0
- funboost/utils/dependency_packages_in_pythonpath/aioredis/client.py +4804 -4804
- funboost/utils/dependency_packages_in_pythonpath/aioredis/compat.py +8 -8
- funboost/utils/dependency_packages_in_pythonpath/aioredis/connection.py +1668 -1668
- funboost/utils/dependency_packages_in_pythonpath/aioredis/exceptions.py +96 -96
- funboost/utils/dependency_packages_in_pythonpath/aioredis/lock.py +306 -306
- funboost/utils/dependency_packages_in_pythonpath/aioredis/log.py +15 -15
- funboost/utils/dependency_packages_in_pythonpath/aioredis/sentinel.py +329 -329
- funboost/utils/dependency_packages_in_pythonpath/aioredis/utils.py +61 -61
- funboost/utils/dependency_packages_in_pythonpath/func_timeout/StoppableThread.py +133 -133
- funboost/utils/dependency_packages_in_pythonpath/func_timeout/__init__.py +16 -16
- funboost/utils/dependency_packages_in_pythonpath/func_timeout/__pycache__/StoppableThread.cpython-311.pyc +0 -0
- funboost/utils/dependency_packages_in_pythonpath/func_timeout/__pycache__/StoppableThread.cpython-37.pyc +0 -0
- funboost/utils/dependency_packages_in_pythonpath/func_timeout/__pycache__/StoppableThread.cpython-39.pyc +0 -0
- funboost/utils/dependency_packages_in_pythonpath/func_timeout/__pycache__/__init__.cpython-311.pyc +0 -0
- funboost/utils/dependency_packages_in_pythonpath/func_timeout/__pycache__/__init__.cpython-37.pyc +0 -0
- funboost/utils/dependency_packages_in_pythonpath/func_timeout/__pycache__/__init__.cpython-39.pyc +0 -0
- funboost/utils/dependency_packages_in_pythonpath/func_timeout/__pycache__/dafunc.cpython-311.pyc +0 -0
- funboost/utils/dependency_packages_in_pythonpath/func_timeout/__pycache__/dafunc.cpython-37.pyc +0 -0
- funboost/utils/dependency_packages_in_pythonpath/func_timeout/__pycache__/dafunc.cpython-39.pyc +0 -0
- funboost/utils/dependency_packages_in_pythonpath/func_timeout/__pycache__/exceptions.cpython-311.pyc +0 -0
- funboost/utils/dependency_packages_in_pythonpath/func_timeout/__pycache__/exceptions.cpython-37.pyc +0 -0
- funboost/utils/dependency_packages_in_pythonpath/func_timeout/__pycache__/exceptions.cpython-39.pyc +0 -0
- funboost/utils/dependency_packages_in_pythonpath/func_timeout/__pycache__/py3_raise.cpython-311.pyc +0 -0
- funboost/utils/dependency_packages_in_pythonpath/func_timeout/__pycache__/py3_raise.cpython-37.pyc +0 -0
- funboost/utils/dependency_packages_in_pythonpath/func_timeout/__pycache__/py3_raise.cpython-39.pyc +0 -0
- funboost/utils/dependency_packages_in_pythonpath/func_timeout/dafunc.py +244 -244
- funboost/utils/dependency_packages_in_pythonpath/func_timeout/exceptions.py +98 -98
- funboost/utils/dependency_packages_in_pythonpath/func_timeout/py2_raise.py +7 -7
- funboost/utils/dependency_packages_in_pythonpath/func_timeout/py3_raise.py +7 -7
- funboost/utils/times/__init__.py +85 -85
- funboost/utils/times/version.py +1 -1
- {funboost-44.7.dist-info → funboost-44.8.dist-info}/METADATA +2 -1
- {funboost-44.7.dist-info → funboost-44.8.dist-info}/RECORD +72 -43
- {funboost-44.7.dist-info → funboost-44.8.dist-info}/entry_points.txt +1 -0
- funboost/function_result_web/__pycache__/functions.cpython-39.pyc +0 -0
- {funboost-44.7.dist-info → funboost-44.8.dist-info}/LICENSE +0 -0
- {funboost-44.7.dist-info → funboost-44.8.dist-info}/WHEEL +0 -0
- {funboost-44.7.dist-info → funboost-44.8.dist-info}/top_level.txt +0 -0
funboost/__init__.py
CHANGED
|
@@ -565,6 +565,9 @@ class AbstractConsumer(LoggerLevelSetterMixin, metaclass=abc.ABCMeta, ):
|
|
|
565
565
|
def user_custom_record_process_info_func(self,current_function_result_status:FunctionResultStatus): # 这个可以继承
|
|
566
566
|
pass
|
|
567
567
|
|
|
568
|
+
async def aio_user_custom_record_process_info_func(self,current_function_result_status:FunctionResultStatus): # 这个可以继承
|
|
569
|
+
pass
|
|
570
|
+
|
|
568
571
|
# noinspection PyProtectedMember
|
|
569
572
|
def _run(self, kw: dict, ):
|
|
570
573
|
# print(kw)
|
|
@@ -636,7 +639,7 @@ class AbstractConsumer(LoggerLevelSetterMixin, metaclass=abc.ABCMeta, ):
|
|
|
636
639
|
self._current_time_for_execute_task_times_every_unit_time = time.time()
|
|
637
640
|
self._consuming_function_cost_time_total_every_unit_time = 0
|
|
638
641
|
self._execute_task_times_every_unit_time = 0
|
|
639
|
-
self.user_custom_record_process_info_func(current_function_result_status) #
|
|
642
|
+
self.user_custom_record_process_info_func(current_function_result_status) # 两种方式都可以自定义,记录结果,建议继承方式,不使用boost中指定 user_custom_record_process_info_func
|
|
640
643
|
if self.consumer_params.user_custom_record_process_info_func:
|
|
641
644
|
self.consumer_params.user_custom_record_process_info_func(current_function_result_status)
|
|
642
645
|
except BaseException as e:
|
|
@@ -804,8 +807,11 @@ class AbstractConsumer(LoggerLevelSetterMixin, metaclass=abc.ABCMeta, ):
|
|
|
804
807
|
self._consuming_function_cost_time_total_every_unit_time = 0
|
|
805
808
|
self._execute_task_times_every_unit_time = 0
|
|
806
809
|
|
|
810
|
+
self.user_custom_record_process_info_func(current_function_result_status) # 两种方式都可以自定义,记录结果.建议使用文档4.21.b的方式继承来重写
|
|
811
|
+
await self.aio_user_custom_record_process_info_func(current_function_result_status)
|
|
807
812
|
if self.consumer_params.user_custom_record_process_info_func:
|
|
808
|
-
|
|
813
|
+
self.consumer_params.user_custom_record_process_info_func(current_function_result_status)
|
|
814
|
+
|
|
809
815
|
except BaseException as e:
|
|
810
816
|
log_msg = f' error 严重错误 {type(e)} {e} '
|
|
811
817
|
# self.logger.critical(msg=f'{log_msg} \n', exc_info=True)
|
funboost/core/current_task.py
CHANGED
|
@@ -148,7 +148,7 @@ asyncio_current_task = __AsyncioCurrentTask()
|
|
|
148
148
|
def funboost_current_task():
|
|
149
149
|
if is_asyncio_environment():
|
|
150
150
|
if getattr(__ThreadCurrentTask._fct_local_data,'_asyncio_use_thread_concurrent_mode',None) is True:
|
|
151
|
-
# 如果用户使用的是默认的ConcurrentModeEnum.THREADING
|
|
151
|
+
# 如果用户使用的是默认的ConcurrentModeEnum.THREADING并发模式来运行async def 函数,那么也使用线程获取上下文
|
|
152
152
|
return thread_current_task
|
|
153
153
|
else:
|
|
154
154
|
return asyncio_current_task
|
|
@@ -10,6 +10,8 @@ from funboost.concurrent_pool import FunboostBaseConcurrentPool, FlexibleThreadP
|
|
|
10
10
|
from funboost.constant import ConcurrentModeEnum, BrokerEnum
|
|
11
11
|
from pydantic import BaseModel, validator, root_validator, BaseConfig, Field
|
|
12
12
|
|
|
13
|
+
from funboost.core.lazy_impoter import funboost_lazy_impoter
|
|
14
|
+
|
|
13
15
|
|
|
14
16
|
def _patch_for_pydantic_field_deepcopy():
|
|
15
17
|
from concurrent.futures import ThreadPoolExecutor
|
|
@@ -213,6 +215,19 @@ class BoosterParams(BaseJsonAbleModel):
|
|
|
213
215
|
raise ValueError(f'{cls.__name__} 的字段新增了父类 BoosterParams 不存在的字段 "{k}"') # 使 BoosterParams的子类,不能增加字段,只能覆盖字段.
|
|
214
216
|
return values
|
|
215
217
|
|
|
218
|
+
def __call__(self, func):
|
|
219
|
+
"""
|
|
220
|
+
新增加一种语法
|
|
221
|
+
@BoosterParams(queue_name='q1',qps=2) 这个和 @boost(BoosterParams(queue_name='q1',qps=2)) 写法等效
|
|
222
|
+
|
|
223
|
+
@BoosterParams(queue_name='q1',qps=2)
|
|
224
|
+
def f(a,b):
|
|
225
|
+
print(a,b)
|
|
226
|
+
:param func:
|
|
227
|
+
:return:
|
|
228
|
+
"""
|
|
229
|
+
return funboost_lazy_impoter.boost(self)(func)
|
|
230
|
+
|
|
216
231
|
|
|
217
232
|
class BoosterParamsComplete(BoosterParams):
|
|
218
233
|
"""
|
funboost/core/lazy_impoter.py
CHANGED
|
@@ -16,8 +16,14 @@ class FunboostLazyImpoter(SingletonBaseNew):
|
|
|
16
16
|
@property
|
|
17
17
|
@cached_method_result
|
|
18
18
|
def BoostersManager(self):
|
|
19
|
-
from funboost.core
|
|
20
|
-
return BoostersManager
|
|
19
|
+
from funboost.core import booster
|
|
20
|
+
return booster.BoostersManager
|
|
21
|
+
|
|
22
|
+
@property
|
|
23
|
+
@cached_method_result
|
|
24
|
+
def boost(self):
|
|
25
|
+
from funboost.core import booster
|
|
26
|
+
return booster.boost
|
|
21
27
|
|
|
22
28
|
# @property
|
|
23
29
|
# @cached_method_result
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
funboost/utils/dependency_packages_in_pythonpath/__pycache__/add_to_pythonpath.cpython-311.pyc
ADDED
|
Binary file
|
|
Binary file
|
funboost/utils/dependency_packages_in_pythonpath/__pycache__/add_to_pythonpath.cpython-39.pyc
CHANGED
|
Binary file
|
|
@@ -1,59 +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
|
-
]
|
|
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
|
+
]
|
funboost/utils/dependency_packages_in_pythonpath/aioredis/__pycache__/__init__.cpython-311.pyc
ADDED
|
Binary file
|
|
Binary file
|
funboost/utils/dependency_packages_in_pythonpath/aioredis/__pycache__/__init__.cpython-39.pyc
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
funboost/utils/dependency_packages_in_pythonpath/aioredis/__pycache__/connection.cpython-311.pyc
ADDED
|
Binary file
|
funboost/utils/dependency_packages_in_pythonpath/aioredis/__pycache__/connection.cpython-37.pyc
ADDED
|
Binary file
|
funboost/utils/dependency_packages_in_pythonpath/aioredis/__pycache__/connection.cpython-39.pyc
CHANGED
|
Binary file
|
funboost/utils/dependency_packages_in_pythonpath/aioredis/__pycache__/exceptions.cpython-311.pyc
ADDED
|
Binary file
|
funboost/utils/dependency_packages_in_pythonpath/aioredis/__pycache__/exceptions.cpython-37.pyc
ADDED
|
Binary file
|
funboost/utils/dependency_packages_in_pythonpath/aioredis/__pycache__/exceptions.cpython-39.pyc
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|