funboost 45.7__py3-none-any.whl → 45.9__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/concurrent_pool/custom_threadpool_executor.py +2 -2
- funboost/concurrent_pool/flexible_thread_pool.py +2 -2
- funboost/core/func_params_model.py +1 -0
- funboost/core/msg_result_getter.py +15 -1
- 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/__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/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-45.7.dist-info → funboost-45.9.dist-info}/METADATA +2 -1
- {funboost-45.7.dist-info → funboost-45.9.dist-info}/RECORD +70 -41
- {funboost-45.7.dist-info → funboost-45.9.dist-info}/entry_points.txt +1 -0
- funboost/function_result_web/__pycache__/functions.cpython-39.pyc +0 -0
- {funboost-45.7.dist-info → funboost-45.9.dist-info}/LICENSE +0 -0
- {funboost-45.7.dist-info → funboost-45.9.dist-info}/WHEEL +0 -0
- {funboost-45.7.dist-info → funboost-45.9.dist-info}/top_level.txt +0 -0
funboost/__init__.py
CHANGED
|
@@ -99,7 +99,7 @@ class ThreadPoolExecutorShrinkAble(Executor, FunboostFileLoggerMixin, LoggerLeve
|
|
|
99
99
|
MIN_WORKERS = 5
|
|
100
100
|
KEEP_ALIVE_TIME = 60
|
|
101
101
|
|
|
102
|
-
def __init__(self, max_workers: int = None, thread_name_prefix=''):
|
|
102
|
+
def __init__(self, max_workers: int = None, thread_name_prefix='',work_queue_maxsize=10):
|
|
103
103
|
"""
|
|
104
104
|
最好需要兼容官方concurren.futures.ThreadPoolExecutor 和改版的BoundedThreadPoolExecutor,入参名字和个数保持了一致。
|
|
105
105
|
:param max_workers:
|
|
@@ -110,7 +110,7 @@ class ThreadPoolExecutorShrinkAble(Executor, FunboostFileLoggerMixin, LoggerLeve
|
|
|
110
110
|
self._thread_name_prefix = thread_name_prefix
|
|
111
111
|
# print(self._max_workers)
|
|
112
112
|
# self.work_queue = self._work_queue = queue.Queue(self._max_workers or 10)
|
|
113
|
-
self.work_queue = self._work_queue = queue.Queue(
|
|
113
|
+
self.work_queue = self._work_queue = queue.Queue(work_queue_maxsize)
|
|
114
114
|
# self._threads = set()
|
|
115
115
|
self._threads = weakref.WeakSet()
|
|
116
116
|
self._lock_compute_threads_free_count = threading.Lock()
|
|
@@ -23,8 +23,8 @@ class FlexibleThreadPool(FunboostFileLoggerMixin, LoggerLevelSetterMixin, Funboo
|
|
|
23
23
|
KEEP_ALIVE_TIME = 10
|
|
24
24
|
MIN_WORKERS = 2
|
|
25
25
|
|
|
26
|
-
def __init__(self, max_workers: int = None):
|
|
27
|
-
self.work_queue = queue.Queue(
|
|
26
|
+
def __init__(self, max_workers: int = None,work_queue_maxsize=10):
|
|
27
|
+
self.work_queue = queue.Queue(work_queue_maxsize)
|
|
28
28
|
self.max_workers = max_workers
|
|
29
29
|
self._threads_num = 0
|
|
30
30
|
self.threads_free_count = 0
|
|
@@ -177,6 +177,7 @@ class BoosterParams(BaseJsonAbleModel):
|
|
|
177
177
|
do_not_run_by_specify_time: tuple = ('10:00:00', '22:00:00') # 不运行的时间段,在这个时间段自动不运行函数.
|
|
178
178
|
|
|
179
179
|
schedule_tasks_on_main_thread: bool = False # 直接在主线程调度任务,意味着不能直接在当前主线程同时开启两个消费者。
|
|
180
|
+
|
|
180
181
|
is_auto_start_consuming_message: bool = False # 是否在定义后就自动启动消费,无需用户手动写 .consume() 来启动消息消费。
|
|
181
182
|
|
|
182
183
|
consuming_function: typing.Callable = None # 消费函数,在@boost时候不用指定,因为装饰器知道下面的函数.
|
|
@@ -20,13 +20,27 @@ NO_RESULT = 'no_result'
|
|
|
20
20
|
|
|
21
21
|
|
|
22
22
|
class AsyncResult(RedisMixin):
|
|
23
|
-
|
|
23
|
+
default_callback_run_executor = FlexibleThreadPoolMinWorkers0(200,work_queue_maxsize=10000)
|
|
24
|
+
|
|
25
|
+
@property
|
|
26
|
+
def callback_run_executor(self, ):
|
|
27
|
+
return self._callback_run_executor or self.default_callback_run_executor
|
|
28
|
+
@callback_run_executor.setter
|
|
29
|
+
def callback_run_executor(self,thread_pool_executor):
|
|
30
|
+
"""
|
|
31
|
+
用户可以 async_result.callback_run_executor = 你自己的线程池
|
|
32
|
+
thread_pool_executor 用户可以传递 FlexibleThreadPool或者 ThreadPoolExecutorShrinkAble 或者官方的 concurrent.futures.ThreadPoolExecutor 类型的对象都可以,任意线程池只要实现了submit方法即可。
|
|
33
|
+
:param thread_pool_executor:
|
|
34
|
+
:return:
|
|
35
|
+
"""
|
|
36
|
+
self._callback_run_executor = thread_pool_executor
|
|
24
37
|
|
|
25
38
|
def __init__(self, task_id, timeout=120):
|
|
26
39
|
self.task_id = task_id
|
|
27
40
|
self.timeout = timeout
|
|
28
41
|
self._has_pop = False
|
|
29
42
|
self._status_and_result = None
|
|
43
|
+
self._callback_run_executor = None
|
|
30
44
|
|
|
31
45
|
def set_timeout(self, timeout=60):
|
|
32
46
|
self.timeout = timeout
|
|
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
|