funboost 40.2__py3-none-any.whl → 40.4__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/core/booster.py +2 -2
- funboost/core/func_params_model.py +14 -3
- funboost/function_result_web/__pycache__/app.cpython-37.pyc +0 -0
- funboost/function_result_web/__pycache__/functions.cpython-37.pyc +0 -0
- funboost/set_frame_config.py +1 -1
- 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 +234 -234
- 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-40.2.dist-info → funboost-40.4.dist-info}/METADATA +547 -544
- {funboost-40.2.dist-info → funboost-40.4.dist-info}/RECORD +70 -40
- {funboost-40.2.dist-info → funboost-40.4.dist-info}/WHEEL +1 -1
- {funboost-40.2.dist-info → funboost-40.4.dist-info}/LICENSE +0 -0
- {funboost-40.2.dist-info → funboost-40.4.dist-info}/entry_points.txt +0 -0
- {funboost-40.2.dist-info → funboost-40.4.dist-info}/top_level.txt +0 -0
funboost/core/booster.py
CHANGED
|
@@ -36,8 +36,8 @@ class Booster:
|
|
|
36
36
|
|
|
37
37
|
"""
|
|
38
38
|
'''
|
|
39
|
-
# @boost('queue_test_f01', qps=0.2,
|
|
40
|
-
@boost(BoosterParams(queue_name='queue_test_f01', qps=0.2,
|
|
39
|
+
# @boost('queue_test_f01', qps=0.2, ) # 老的入参方式
|
|
40
|
+
@boost(BoosterParams(queue_name='queue_test_f01', qps=0.2, )) # 新的入参方式,所有入参放在 最流行的三方包 pydantic model BoosterParams 里面.
|
|
41
41
|
def f(a, b):
|
|
42
42
|
print(a + b)
|
|
43
43
|
|
|
@@ -7,7 +7,7 @@ from collections import OrderedDict
|
|
|
7
7
|
|
|
8
8
|
from funboost.concurrent_pool import FunboostBaseConcurrentPool
|
|
9
9
|
from funboost.constant import ConcurrentModeEnum, BrokerEnum
|
|
10
|
-
from pydantic import BaseModel, validator, root_validator, PrivateAttr, Field
|
|
10
|
+
from pydantic import BaseModel, validator, root_validator, PrivateAttr, Field, BaseConfig
|
|
11
11
|
|
|
12
12
|
# noinspection PyUnresolvedReferences
|
|
13
13
|
from funboost.core.loggers import develop_logger
|
|
@@ -32,6 +32,9 @@ def patch_for_pydantic_field_deepcopy():
|
|
|
32
32
|
|
|
33
33
|
patch_for_pydantic_field_deepcopy()
|
|
34
34
|
|
|
35
|
+
class NoExtraFieldsConfig(BaseConfig):
|
|
36
|
+
allow_mutation = False
|
|
37
|
+
extra = "forbid"
|
|
35
38
|
|
|
36
39
|
class BaseJsonAbleModel(BaseModel):
|
|
37
40
|
"""
|
|
@@ -72,9 +75,10 @@ class BaseJsonAbleModel(BaseModel):
|
|
|
72
75
|
setattr(self, k, v)
|
|
73
76
|
return self
|
|
74
77
|
|
|
75
|
-
class Config:
|
|
78
|
+
class Config(BaseConfig):
|
|
76
79
|
arbitrary_types_allowed = True
|
|
77
|
-
|
|
80
|
+
# allow_mutation = False
|
|
81
|
+
extra = "forbid"
|
|
78
82
|
|
|
79
83
|
class FunctionResultStatusPersistanceConfig(BaseJsonAbleModel):
|
|
80
84
|
is_save_status: bool # 是否保存函数的运行状态信息
|
|
@@ -181,6 +185,11 @@ class BoosterParams(BaseJsonAbleModel):
|
|
|
181
185
|
|
|
182
186
|
if values['concurrent_mode'] not in ConcurrentModeEnum.__dict__.values():
|
|
183
187
|
raise ValueError('设置的并发模式不正确')
|
|
188
|
+
# if not set(values.keys()).issubset(set(BoosterParams.__fields__.keys())):
|
|
189
|
+
# raise ValueError(f'{cls.__name__} 的字段包含了父类 BoosterParams 不存在的字段')
|
|
190
|
+
for k in values.keys():
|
|
191
|
+
if k not in BoosterParams.__fields__.keys():
|
|
192
|
+
raise ValueError(f'{cls.__name__} 的字段新增了父类 BoosterParams 不存在的字段 "{k}"') # 使 BoosterParams的子类,不能增加字段,只能覆盖字段.
|
|
184
193
|
return values
|
|
185
194
|
|
|
186
195
|
|
|
@@ -243,3 +252,5 @@ if __name__ == '__main__':
|
|
|
243
252
|
# print(FunctionResultStatusPersistanceConfig(is_save_result=True, is_save_status=True, expire_seconds=70 * 24 * 3600).update_from_kwargs(expire_seconds=100).get_str_dict())
|
|
244
253
|
#
|
|
245
254
|
# print(PriorityConsumingControlConfig().get_str_dict())
|
|
255
|
+
|
|
256
|
+
print(BoosterParams(queue_name='3213'))
|
|
Binary file
|
|
Binary file
|
funboost/set_frame_config.py
CHANGED
|
@@ -140,7 +140,7 @@ def use_config_form_funboost_config_module():
|
|
|
140
140
|
funboost_config_deafult.FunboostCommonConfig.update_cls_attribute(**m.FunboostCommonConfig().get_dict())
|
|
141
141
|
# funboost_config_deafult.BoostDecoratorDefaultParams.update_cls_attribute(**m.BoostDecoratorDefaultParams().get_dict())
|
|
142
142
|
if hasattr(m,'BoostDecoratorDefaultParams'):
|
|
143
|
-
raise ValueError('funboost 40.0版本之后,采用 pydantic model BoostParams类或子类入参,不支持 funboost_config.py的 BoostDecoratorDefaultParams
|
|
143
|
+
raise ValueError('funboost 40.0版本之后,采用 pydantic model BoostParams类或子类入参,不支持 funboost_config.py的 BoostDecoratorDefaultParams 配置,请删除掉 BoostDecoratorDefaultParams 这个配置')
|
|
144
144
|
|
|
145
145
|
|
|
146
146
|
except ModuleNotFoundError:
|
|
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
|