funboost 48.8__py3-none-any.whl → 49.0__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 +1 -1
- funboost/constant.py +16 -2
- funboost/consumers/base_consumer.py +42 -29
- funboost/consumers/rabbitmq_amqpstorm_consumer.py +5 -0
- funboost/consumers/redis_filter.py +47 -31
- funboost/core/active_cousumer_info_getter.py +47 -7
- funboost/core/booster.py +1 -0
- funboost/core/current_task.py +17 -0
- funboost/core/func_params_model.py +30 -17
- funboost/core/loggers.py +1 -0
- funboost/funboost_config_deafult.py +1 -1
- funboost/function_result_web/__pycache__/app.cpython-37.pyc +0 -0
- funboost/function_result_web/__pycache__/functions.cpython-37.pyc +0 -0
- funboost/function_result_web/__pycache__/functions.cpython-39.pyc +0 -0
- funboost/function_result_web/app_debug_start.py +1 -1
- funboost/function_result_web/functions.py +10 -1
- funboost/function_result_web/static/js/form-memory.js +92 -0
- funboost/function_result_web/static/js_cdn/chart.js +20 -0
- funboost/function_result_web/templates/index.html +31 -1
- funboost/function_result_web/templates/queue_op.html +418 -27
- funboost/function_result_web/templates/rpc_call.html +51 -37
- funboost/publishers/rabbitmq_amqpstorm_publisher.py +1 -1
- funboost/publishers/redis_publisher_priority.py +2 -2
- funboost/utils/dependency_packages_in_pythonpath/aioredis/readme.md +1 -1
- funboost/utils/dependency_packages_in_pythonpath/readme.md +1 -1
- {funboost-48.8.dist-info → funboost-49.0.dist-info}/METADATA +176 -82
- {funboost-48.8.dist-info → funboost-49.0.dist-info}/RECORD +32 -31
- {funboost-48.8.dist-info → funboost-49.0.dist-info}/WHEEL +1 -1
- funboost/function_result_web/templates/index_/321/204/342/225/225/320/235/321/205/320/237/320/277/321/206/320/232/320/250/321/205/320/237/320/260.html +0 -153
- {funboost-48.8.dist-info → funboost-49.0.dist-info}/LICENSE +0 -0
- {funboost-48.8.dist-info → funboost-49.0.dist-info}/entry_points.txt +0 -0
- {funboost-48.8.dist-info → funboost-49.0.dist-info}/top_level.txt +0 -0
|
@@ -52,49 +52,55 @@
|
|
|
52
52
|
<!-- 添加发布消息和RPC结果区域 -->
|
|
53
53
|
<div class="row" style="margin-top: 20px;">
|
|
54
54
|
<div class="col-md-6">
|
|
55
|
-
<
|
|
56
|
-
|
|
57
|
-
<div
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
<
|
|
62
|
-
|
|
55
|
+
<div style="background-color: #f9f9f9; border-radius: 8px; padding: 20px; border-left: 5px solid #3498db; box-shadow: 0 2px 5px rgba(0,0,0,0.1);">
|
|
56
|
+
<h1 style="margin-bottom: 20px;color: red;">发送rpc请求:</h1>
|
|
57
|
+
<div class="form-group">
|
|
58
|
+
<div style="display: flex; align-items: center; margin-bottom: 10px;">
|
|
59
|
+
|
|
60
|
+
<label for="col_name_search" style="margin-right: 5px; white-space: nowrap;">队列名字:</label>
|
|
61
|
+
<select class="form-control" id="col_name_search" style="width: 500px;">
|
|
62
|
+
<option value="">请选择队列名字...</option>
|
|
63
|
+
</select>
|
|
64
|
+
</div>
|
|
65
|
+
<textarea class="form-control" id="message_content" rows="7" placeholder="请输入消息体JSON格式,如:{"x":1,"y":2}"></textarea>
|
|
63
66
|
</div>
|
|
64
|
-
<
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
67
|
+
<div class="form-inline" style="margin-bottom: 15px;">
|
|
68
|
+
<div class="checkbox" style="margin-right: 20px;">
|
|
69
|
+
<label>
|
|
70
|
+
<input type="checkbox" id="need_result" checked> 需要返回结果
|
|
71
|
+
</label>
|
|
72
|
+
</div>
|
|
73
|
+
<div class="form-group" style="margin-right: 20px;">
|
|
74
|
+
<label for="timeout" style="margin-right: 5px;">超时时间(秒):</label>
|
|
75
|
+
<input type="number" class="form-control" id="timeout" value="60" style="width: 80px;">
|
|
76
|
+
</div>
|
|
77
|
+
<button type="button" class="btn btn-primary" id="send_btn">发送RPC请求</button>
|
|
71
78
|
</div>
|
|
72
|
-
<div class="
|
|
73
|
-
|
|
74
|
-
<input type="number" class="form-control" id="timeout" value="60" style="width: 80px;">
|
|
79
|
+
<div class="alert alert-info" id="status_display" style="margin-top: 10px;">
|
|
80
|
+
准备发送RPC请求,请选择队列名称并输入消息内容
|
|
75
81
|
</div>
|
|
76
|
-
<button type="button" class="btn btn-primary" id="send_btn">发送RPC请求</button>
|
|
77
|
-
</div>
|
|
78
|
-
<div class="alert alert-info" id="status_display" style="margin-top: 10px;">
|
|
79
|
-
准备发送RPC请求,请选择队列名称并输入消息内容
|
|
80
82
|
</div>
|
|
81
83
|
|
|
82
|
-
<
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
84
|
+
<hr style="border-top: 2px dashed #3498db; margin: 40px 0;">
|
|
85
|
+
|
|
86
|
+
<div style="background-color: #f9f9f9; border-radius: 8px; padding: 20px; border-left: 5px solid #e74c3c; box-shadow: 0 2px 5px rgba(0,0,0,0.1);">
|
|
87
|
+
<h1 style="margin-bottom: 20px;color: red;">获取task_id结果:</h1>
|
|
88
|
+
<div class="form-group">
|
|
89
|
+
<div style="display: flex; align-items: center;">
|
|
90
|
+
<label for="task_id" style="margin-right: 5px; white-space: nowrap;">task_id:</label>
|
|
91
|
+
<input type="text" class="form-control" id="task_id" style="width: 500px; margin-right: 15px;">
|
|
92
|
+
</div>
|
|
87
93
|
</div>
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
94
|
+
<div style="display: flex; align-items: center; margin-bottom: 15px;">
|
|
95
|
+
<div style="margin-right: 20px; display: flex; align-items: center;">
|
|
96
|
+
<label for="task_timeout" style="margin-right: 5px; white-space: nowrap;">超时时间(秒):</label>
|
|
97
|
+
<input type="number" class="form-control" id="task_timeout" value="30" style="width: 80px;">
|
|
98
|
+
</div>
|
|
99
|
+
<button type="button" class="btn btn-primary" id="get_result_btn">获取结果</button>
|
|
100
|
+
</div>
|
|
101
|
+
<div class="alert alert-info" id="task_status_display" style="margin-top: 10px;">
|
|
102
|
+
准备获取结果,请输入task_id
|
|
93
103
|
</div>
|
|
94
|
-
<button type="button" class="btn btn-primary" id="get_result_btn">获取结果</button>
|
|
95
|
-
</div>
|
|
96
|
-
<div class="alert alert-info" id="task_status_display" style="margin-top: 10px;">
|
|
97
|
-
准备获取结果,请输入task_id
|
|
98
104
|
</div>
|
|
99
105
|
|
|
100
106
|
|
|
@@ -104,7 +110,7 @@
|
|
|
104
110
|
<div class="col-md-6">
|
|
105
111
|
<div class="form-group">
|
|
106
112
|
<label for="rpc_result">RPC结果:</label>
|
|
107
|
-
<textarea class="form-control" id="rpc_result" rows="
|
|
113
|
+
<textarea class="form-control" id="rpc_result" rows="39" readonly style="background-color: #1e1e1e; color: #ffffff; font-family: Consolas, Monaco, 'Courier New', monospace; border: 1px solid #333;"></textarea>
|
|
108
114
|
</div>
|
|
109
115
|
</div>
|
|
110
116
|
</div>
|
|
@@ -195,6 +201,7 @@
|
|
|
195
201
|
|
|
196
202
|
// 清空结果框
|
|
197
203
|
$("#rpc_result").val("");
|
|
204
|
+
$("#rpc_result").css({"background-color": "#1e1e1e", "color": "#ffffff"});
|
|
198
205
|
|
|
199
206
|
// 发送RPC请求
|
|
200
207
|
$.ajax({
|
|
@@ -217,13 +224,16 @@
|
|
|
217
224
|
if (result.succ) {
|
|
218
225
|
$("#status_display").removeClass("alert-warning alert-danger").addClass("alert-success");
|
|
219
226
|
$("#status_display").text("RPC请求成功: " + result.msg);
|
|
227
|
+
$("#rpc_result").css({"background-color": "#5cb85c", "color": "#ffffff"});
|
|
220
228
|
} else {
|
|
221
229
|
$("#status_display").removeClass("alert-warning alert-success").addClass("alert-danger");
|
|
222
230
|
$("#status_display").text("RPC请求失败: " + result.msg);
|
|
231
|
+
$("#rpc_result").css({"background-color": "#d9534f", "color": "#ffffff"});
|
|
223
232
|
}
|
|
224
233
|
},
|
|
225
234
|
error: function(xhr, status, error) {
|
|
226
235
|
$("#rpc_result").val("请求失败: " + error);
|
|
236
|
+
$("#rpc_result").css({"background-color": "#d9534f", "color": "#ffffff"});
|
|
227
237
|
|
|
228
238
|
// 更新状态显示
|
|
229
239
|
$("#status_display").removeClass("alert-warning alert-success").addClass("alert-danger");
|
|
@@ -250,6 +260,7 @@
|
|
|
250
260
|
|
|
251
261
|
// 清空结果框
|
|
252
262
|
$("#rpc_result").val("");
|
|
263
|
+
$("#rpc_result").css({"background-color": "#1e1e1e", "color": "#ffffff"});
|
|
253
264
|
|
|
254
265
|
// 获取结果
|
|
255
266
|
$.ajax({
|
|
@@ -267,13 +278,16 @@
|
|
|
267
278
|
if (result.succ) {
|
|
268
279
|
$("#task_status_display").removeClass("alert-warning alert-danger").addClass("alert-success");
|
|
269
280
|
$("#task_status_display").text("获取结果成功");
|
|
281
|
+
$("#rpc_result").css({"background-color": "#5cb85c", "color": "#ffffff"});
|
|
270
282
|
} else {
|
|
271
283
|
$("#task_status_display").removeClass("alert-warning alert-success").addClass("alert-danger");
|
|
272
284
|
$("#task_status_display").text("获取结果失败: " + result.msg);
|
|
285
|
+
$("#rpc_result").css({"background-color": "#d9534f", "color": "#ffffff"});
|
|
273
286
|
}
|
|
274
287
|
},
|
|
275
288
|
error: function(xhr, status, error) {
|
|
276
289
|
$("#rpc_result").val("请求失败: " + error);
|
|
290
|
+
$("#rpc_result").css({"background-color": "#d9534f", "color": "#ffffff"});
|
|
277
291
|
|
|
278
292
|
// 更新状态显示
|
|
279
293
|
$("#task_status_display").removeClass("alert-warning alert-success").addClass("alert-danger");
|
|
@@ -20,7 +20,7 @@ class RabbitmqPublisherUsingAmqpStorm(AbstractPublisher):
|
|
|
20
20
|
|
|
21
21
|
def custom_init(self):
|
|
22
22
|
arguments = {} # {'x-queue-type':'classic'} classic stream lazy quorum
|
|
23
|
-
if self.publisher_params.broker_exclusive_config
|
|
23
|
+
if self.publisher_params.broker_exclusive_config.get('x-max-priority'):
|
|
24
24
|
arguments['x-max-priority'] = self.publisher_params.broker_exclusive_config['x-max-priority']
|
|
25
25
|
self.queue_declare_params = dict(queue=self._queue_name, durable=self.DURABLE, arguments=arguments,auto_delete=False)
|
|
26
26
|
|
|
@@ -14,7 +14,7 @@ class RedisPriorityPublisher(FlushRedisQueueMixin,AbstractPublisher, RedisMixin,
|
|
|
14
14
|
|
|
15
15
|
def custom_init(self):
|
|
16
16
|
queue_list = [self._queue_name]
|
|
17
|
-
x_max_priority = self.publisher_params.broker_exclusive_config
|
|
17
|
+
x_max_priority = self.publisher_params.broker_exclusive_config.get('x-max-priority')
|
|
18
18
|
if x_max_priority:
|
|
19
19
|
for i in range(1, x_max_priority + 1):
|
|
20
20
|
queue_list.append(f'{self.queue_name}:{i}')
|
|
@@ -28,7 +28,7 @@ class RedisPriorityPublisher(FlushRedisQueueMixin,AbstractPublisher, RedisMixin,
|
|
|
28
28
|
:return:
|
|
29
29
|
"""
|
|
30
30
|
priority = self._get_from_other_extra_params('priroty', msg)
|
|
31
|
-
x_max_priority = self.publisher_params.broker_exclusive_config
|
|
31
|
+
x_max_priority = self.publisher_params.broker_exclusive_config('x-max-priority')
|
|
32
32
|
queue_name = self.queue_name
|
|
33
33
|
if x_max_priority and priority:
|
|
34
34
|
priority = min(priority, x_max_priority) # 防止有傻瓜发布消息的优先级priroty比最大支持的优先级还高。
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: funboost
|
|
3
|
-
Version:
|
|
3
|
+
Version: 49.0
|
|
4
4
|
Summary: pip install funboost,python全功能分布式函数调度框架,funboost的功能是全面性重量级,用户能想得到的功能99%全都有;funboost的使用方式是轻量级,只有@boost一行代码需要写。支持python所有类型的并发模式和一切知名消息队列中间件,支持如 celery dramatiq等框架整体作为funboost中间件,python函数加速器,框架包罗万象,用户能想到的控制功能全都有。一统编程思维,兼容50% python业务场景,适用范围广。只需要一行代码即可分布式执行python一切函数,funboost web manager 方便查看和管理消费函数;99%用过funboost的pythoner 感受是 简易 方便 强劲 强大,相见恨晚
|
|
5
5
|
Home-page: https://github.com/ydf0509/funboost
|
|
6
6
|
Author: bfzs
|
|
@@ -27,29 +27,29 @@ Classifier: Programming Language :: Python :: 3 :: Only
|
|
|
27
27
|
Classifier: Topic :: Software Development :: Libraries
|
|
28
28
|
Description-Content-Type: text/markdown
|
|
29
29
|
License-File: LICENSE
|
|
30
|
-
Requires-Dist:
|
|
31
|
-
Requires-Dist:
|
|
32
|
-
Requires-Dist:
|
|
33
|
-
Requires-Dist: pymongo>=4.6.3
|
|
34
|
-
Requires-Dist: AMQPStorm==2.10.6
|
|
35
|
-
Requires-Dist: rabbitpy==2.0.1
|
|
36
|
-
Requires-Dist: decorator==5.1.1
|
|
37
|
-
Requires-Dist: tomorrow3==1.1.0
|
|
38
|
-
Requires-Dist: persist-queue>=0.4.2
|
|
39
|
-
Requires-Dist: apscheduler<4.0.0,>=3.10.1
|
|
30
|
+
Requires-Dist: nb-log >=13.2
|
|
31
|
+
Requires-Dist: nb-libs >=1.8
|
|
32
|
+
Requires-Dist: nb-time >=2.4
|
|
33
|
+
Requires-Dist: pymongo >=4.6.3
|
|
34
|
+
Requires-Dist: AMQPStorm ==2.10.6
|
|
35
|
+
Requires-Dist: rabbitpy ==2.0.1
|
|
36
|
+
Requires-Dist: decorator ==5.1.1
|
|
37
|
+
Requires-Dist: tomorrow3 ==1.1.0
|
|
38
|
+
Requires-Dist: persist-queue >=0.4.2
|
|
39
|
+
Requires-Dist: apscheduler <4.0.0,>=3.10.1
|
|
40
40
|
Requires-Dist: pikav0
|
|
41
41
|
Requires-Dist: pikav1
|
|
42
42
|
Requires-Dist: redis2
|
|
43
43
|
Requires-Dist: redis3
|
|
44
44
|
Requires-Dist: redis5
|
|
45
45
|
Requires-Dist: redis
|
|
46
|
-
Requires-Dist:
|
|
47
|
-
Requires-Dist: fabric2>=2.6.0
|
|
48
|
-
Requires-Dist:
|
|
46
|
+
Requires-Dist: setuptools-rust
|
|
47
|
+
Requires-Dist: fabric2 >=2.6.0
|
|
48
|
+
Requires-Dist: nb-filelock
|
|
49
49
|
Requires-Dist: pysnooper
|
|
50
50
|
Requires-Dist: deprecated
|
|
51
51
|
Requires-Dist: cryptography
|
|
52
|
-
Requires-Dist:
|
|
52
|
+
Requires-Dist: auto-run-on-remote
|
|
53
53
|
Requires-Dist: frozenlist
|
|
54
54
|
Requires-Dist: fire
|
|
55
55
|
Requires-Dist: pydantic
|
|
@@ -57,66 +57,66 @@ Requires-Dist: orjson
|
|
|
57
57
|
Requires-Dist: async-timeout
|
|
58
58
|
Requires-Dist: typing-extensions
|
|
59
59
|
Provides-Extra: all
|
|
60
|
-
Requires-Dist:
|
|
61
|
-
Requires-Dist:
|
|
62
|
-
Requires-Dist:
|
|
63
|
-
Requires-Dist:
|
|
64
|
-
Requires-Dist:
|
|
65
|
-
Requires-Dist: sqlalchemy==
|
|
66
|
-
Requires-Dist:
|
|
67
|
-
Requires-Dist:
|
|
68
|
-
Requires-Dist:
|
|
69
|
-
Requires-Dist:
|
|
70
|
-
Requires-Dist:
|
|
71
|
-
Requires-Dist:
|
|
72
|
-
Requires-Dist:
|
|
73
|
-
Requires-Dist:
|
|
74
|
-
Requires-Dist:
|
|
75
|
-
Requires-Dist:
|
|
76
|
-
Requires-Dist:
|
|
77
|
-
Requires-Dist:
|
|
78
|
-
Requires-Dist:
|
|
79
|
-
Requires-Dist:
|
|
80
|
-
Requires-Dist:
|
|
81
|
-
Requires-Dist:
|
|
82
|
-
Requires-Dist:
|
|
83
|
-
Requires-Dist:
|
|
84
|
-
Requires-Dist: flask; extra ==
|
|
85
|
-
Requires-Dist:
|
|
86
|
-
Requires-Dist:
|
|
87
|
-
Requires-Dist:
|
|
88
|
-
Requires-Dist:
|
|
89
|
-
Provides-Extra:
|
|
90
|
-
Requires-Dist:
|
|
91
|
-
Requires-Dist:
|
|
92
|
-
Requires-Dist:
|
|
93
|
-
Requires-Dist:
|
|
94
|
-
Requires-Dist:
|
|
95
|
-
Requires-Dist: sqlalchemy==
|
|
96
|
-
Requires-Dist:
|
|
97
|
-
Requires-Dist:
|
|
98
|
-
Requires-Dist:
|
|
99
|
-
Requires-Dist:
|
|
100
|
-
Requires-Dist:
|
|
101
|
-
Requires-Dist:
|
|
102
|
-
Requires-Dist:
|
|
103
|
-
Requires-Dist:
|
|
104
|
-
Requires-Dist:
|
|
105
|
-
Requires-Dist:
|
|
106
|
-
Requires-Dist:
|
|
107
|
-
Requires-Dist:
|
|
108
|
-
Requires-Dist:
|
|
109
|
-
Requires-Dist:
|
|
110
|
-
Requires-Dist:
|
|
111
|
-
Requires-Dist:
|
|
112
|
-
Requires-Dist:
|
|
113
|
-
Requires-Dist:
|
|
60
|
+
Requires-Dist: confluent-kafka ==1.7.0 ; extra == 'all'
|
|
61
|
+
Requires-Dist: celery ; extra == 'all'
|
|
62
|
+
Requires-Dist: flower ; extra == 'all'
|
|
63
|
+
Requires-Dist: nameko ==2.14.1 ; extra == 'all'
|
|
64
|
+
Requires-Dist: sqlalchemy ==1.4.13 ; extra == 'all'
|
|
65
|
+
Requires-Dist: sqlalchemy-utils ==0.36.1 ; extra == 'all'
|
|
66
|
+
Requires-Dist: dramatiq ==1.14.2 ; extra == 'all'
|
|
67
|
+
Requires-Dist: huey ==2.4.5 ; extra == 'all'
|
|
68
|
+
Requires-Dist: rq ==1.15.0 ; extra == 'all'
|
|
69
|
+
Requires-Dist: kombu ; extra == 'all'
|
|
70
|
+
Requires-Dist: eventlet ==0.33.3 ; extra == 'all'
|
|
71
|
+
Requires-Dist: gevent ==22.10.2 ; extra == 'all'
|
|
72
|
+
Requires-Dist: elasticsearch ; extra == 'all'
|
|
73
|
+
Requires-Dist: gnsq ==1.0.1 ; extra == 'all'
|
|
74
|
+
Requires-Dist: psutil ; extra == 'all'
|
|
75
|
+
Requires-Dist: peewee ==3.17.3 ; extra == 'all'
|
|
76
|
+
Requires-Dist: nats-python ; extra == 'all'
|
|
77
|
+
Requires-Dist: aiohttp ==3.8.3 ; extra == 'all'
|
|
78
|
+
Requires-Dist: paho-mqtt ; extra == 'all'
|
|
79
|
+
Requires-Dist: rocketmq ; extra == 'all'
|
|
80
|
+
Requires-Dist: zmq ; extra == 'all'
|
|
81
|
+
Requires-Dist: pyzmq ; extra == 'all'
|
|
82
|
+
Requires-Dist: kafka-python ==2.0.2 ; extra == 'all'
|
|
83
|
+
Requires-Dist: flask ; extra == 'all'
|
|
84
|
+
Requires-Dist: flask-bootstrap ; extra == 'all'
|
|
85
|
+
Requires-Dist: flask-wtf ; extra == 'all'
|
|
86
|
+
Requires-Dist: wtforms ; extra == 'all'
|
|
87
|
+
Requires-Dist: flask-login ; extra == 'all'
|
|
88
|
+
Requires-Dist: pulsar-client ==3.1.0 ; (python_version >= "3.7") and extra == 'all'
|
|
89
|
+
Provides-Extra: extra_brokers
|
|
90
|
+
Requires-Dist: confluent-kafka ==1.7.0 ; extra == 'extra_brokers'
|
|
91
|
+
Requires-Dist: celery ; extra == 'extra_brokers'
|
|
92
|
+
Requires-Dist: flower ; extra == 'extra_brokers'
|
|
93
|
+
Requires-Dist: nameko ==2.14.1 ; extra == 'extra_brokers'
|
|
94
|
+
Requires-Dist: sqlalchemy ==1.4.13 ; extra == 'extra_brokers'
|
|
95
|
+
Requires-Dist: sqlalchemy-utils ==0.36.1 ; extra == 'extra_brokers'
|
|
96
|
+
Requires-Dist: dramatiq ==1.14.2 ; extra == 'extra_brokers'
|
|
97
|
+
Requires-Dist: huey ==2.4.5 ; extra == 'extra_brokers'
|
|
98
|
+
Requires-Dist: rq ==1.15.0 ; extra == 'extra_brokers'
|
|
99
|
+
Requires-Dist: kombu ; extra == 'extra_brokers'
|
|
100
|
+
Requires-Dist: eventlet ==0.33.3 ; extra == 'extra_brokers'
|
|
101
|
+
Requires-Dist: gevent ==22.10.2 ; extra == 'extra_brokers'
|
|
102
|
+
Requires-Dist: elasticsearch ; extra == 'extra_brokers'
|
|
103
|
+
Requires-Dist: gnsq ==1.0.1 ; extra == 'extra_brokers'
|
|
104
|
+
Requires-Dist: psutil ; extra == 'extra_brokers'
|
|
105
|
+
Requires-Dist: peewee ==3.17.3 ; extra == 'extra_brokers'
|
|
106
|
+
Requires-Dist: nats-python ; extra == 'extra_brokers'
|
|
107
|
+
Requires-Dist: aiohttp ==3.8.3 ; extra == 'extra_brokers'
|
|
108
|
+
Requires-Dist: paho-mqtt ; extra == 'extra_brokers'
|
|
109
|
+
Requires-Dist: rocketmq ; extra == 'extra_brokers'
|
|
110
|
+
Requires-Dist: zmq ; extra == 'extra_brokers'
|
|
111
|
+
Requires-Dist: pyzmq ; extra == 'extra_brokers'
|
|
112
|
+
Requires-Dist: kafka-python ==2.0.2 ; extra == 'extra_brokers'
|
|
113
|
+
Requires-Dist: pulsar-client ==3.1.0 ; (python_version >= "3.7") and extra == 'extra_brokers'
|
|
114
114
|
Provides-Extra: flask
|
|
115
|
-
Requires-Dist: flask; extra ==
|
|
116
|
-
Requires-Dist:
|
|
117
|
-
Requires-Dist:
|
|
118
|
-
Requires-Dist: wtforms; extra ==
|
|
119
|
-
Requires-Dist:
|
|
115
|
+
Requires-Dist: flask ; extra == 'flask'
|
|
116
|
+
Requires-Dist: flask-bootstrap ; extra == 'flask'
|
|
117
|
+
Requires-Dist: flask-wtf ; extra == 'flask'
|
|
118
|
+
Requires-Dist: wtforms ; extra == 'flask'
|
|
119
|
+
Requires-Dist: flask-login ; extra == 'flask'
|
|
120
120
|
|
|
121
121
|
|
|
122
122
|
|
|
@@ -138,6 +138,8 @@ Requires-Dist: flask_login; extra == "flask"
|
|
|
138
138
|
pip install funboost ,python全功能分布式函数调度框架。 demo用法例子见文档1.3
|
|
139
139
|
|
|
140
140
|
funboost的功能是全面性重量级,用户能想得到的功能99%全都有;funboost的使用方式是轻量级,只有@boost一行代码需要写。
|
|
141
|
+
funboost的神奇之处在于它同时拥有"轻量级使用方式"和"重量级功能集",完全颠覆了"功能强大=使用复杂"的传统思维。
|
|
142
|
+
它证明了一个框架可以既功能丰富又极其易用,这是对传统Python框架设计的一次巧妙超越。
|
|
141
143
|
|
|
142
144
|
只需要一行@boost代码即可分布式执行python一切任意函数,99%用过funboost的pythoner 感受是 方便 快速 强大。
|
|
143
145
|
支持python所有类型的并发模式,消息队列方面支持全球一切知名消息队列中间件和模拟的实现消息队列,
|
|
@@ -145,7 +147,11 @@ funboost的功能是全面性重量级,用户能想得到的功能99%全都有
|
|
|
145
147
|
也支持huey dramatiq rq等任务队列框架作为funboost的broker。
|
|
146
148
|
|
|
147
149
|
python函数加速器,框架包罗万象,一统编程思维,兼容50% python编程业务场景,适用范围广。
|
|
148
|
-
python万能分布式函数调度框架,支持5种并发模式,30+种消息队列中间件
|
|
150
|
+
python万能分布式函数调度框架,支持5种并发模式,30+种消息队列中间件
|
|
151
|
+
(不仅支持几乎所有你能想到的消息队列中间件,还支持本地磁盘队列、数据库队列 (SQLAlchemy, Peewee)、
|
|
152
|
+
内存队列、甚至是 HTTP 请求、WebSocket 等作为任务队列,甚至是将 Celery、Dramatiq、Huey 等其他框架整体作为其
|
|
153
|
+
Broker。funboost源码高扩展性的设计,造成“万物皆可为Broker”,并不是有30种传统意义上的经典消息队列,
|
|
154
|
+
因为世界上总共都没有30种知名的经典消息队列),
|
|
149
155
|
30种任务控制功能。给任意python函数赋能。
|
|
150
156
|
用途概念就是常规经典的 生产者 + 消息队列中间件 + 消费者 编程思想。
|
|
151
157
|
|
|
@@ -191,9 +197,41 @@ funboost的旧框架名字是function_scheduling_distributed_framework , 关系
|
|
|
191
197
|
### 1.0.1 [分布式函数调度框架文档地址 ](https://funboost.readthedocs.io/zh-cn/latest/index.html)
|
|
192
198
|
[查看分布式函数调度框架文档 https://funboost.readthedocs.io/zh-cn/latest/index.html](https://funboost.readthedocs.io/zh-cn/latest/index.html)
|
|
193
199
|
|
|
200
|
+
文档很长,大部分都是讲原理和对比各种框架。但是用户只需要学习1.3这1个例子就能掌握了。因为其他例子只是 @boost的 BoosterParams 里面的控制入参换了一下。
|
|
194
201
|
|
|
195
|
-
|
|
196
|
-
|
|
202
|
+
用户只需要专门看 BoosterParams 里面的每个入参的注释就能掌握框架了,因为funboost只有@boost一行代码需要你写。
|
|
203
|
+
|
|
204
|
+
funboost 框架和一般的框架不一样,因为只有一行代码需要掌握,绝对不是要求用户先精通框架本身才能自由发挥。
|
|
205
|
+
|
|
206
|
+
#### [1.python万能分布式函数调度框架简funboost简介](https://funboost.readthedocs.io/zh-cn/latest/articles/c1.html)
|
|
207
|
+
#### [2. funboost对比celery框架](https://funboost.readthedocs.io/zh-cn/latest/articles/c2.html)
|
|
208
|
+
|
|
209
|
+
#### [3.funboost框架详细介绍](https://funboost.readthedocs.io/zh-cn/latest/articles/c3.html)
|
|
210
|
+
|
|
211
|
+
#### [4.funboost使用框架的各种代码示例](https://funboost.readthedocs.io/zh-cn/latest/articles/c4.html)
|
|
212
|
+
|
|
213
|
+
#### [4b.funboost使用框架的各种代码示例(高级进阶)](https://funboost.readthedocs.io/zh-cn/latest/articles/c4b.html)
|
|
214
|
+
|
|
215
|
+
#### [5.funboost框架运行时截图](https://funboost.readthedocs.io/zh-cn/latest/articles/c5.html)
|
|
216
|
+
|
|
217
|
+
#### [6.funboost常见问题回答](https://funboost.readthedocs.io/zh-cn/latest/articles/c6.html)
|
|
218
|
+
|
|
219
|
+
#### [7.funboost更新记录](https://funboost.readthedocs.io/zh-cn/latest/articles/c7.html)
|
|
220
|
+
|
|
221
|
+
#### [8.funboost是万能函数调度框架,当然可以爬虫,自由编程 降维打击 框架奴役](https://funboost.readthedocs.io/zh-cn/latest/articles/c8.html)
|
|
222
|
+
|
|
223
|
+
#### [9.轻松远程服务器部署运行函数](https://funboost.readthedocs.io/zh-cn/latest/articles/c9.html#)
|
|
224
|
+
|
|
225
|
+
#### [10.python3.6-3.12 安装/使用funboost出错问题反馈](https://funboost.readthedocs.io/zh-cn/latest/articles/c10.html)
|
|
226
|
+
|
|
227
|
+
#### [11.funboost 使用某些中间件或三方任务队列框架作为broker的例子(包括celery框架)。](https://funboost.readthedocs.io/zh-cn/latest/articles/c11.html)
|
|
228
|
+
|
|
229
|
+
#### [12.funboost 控制台支持命令行](https://funboost.readthedocs.io/zh-cn/latest/articles/c12.html)
|
|
230
|
+
|
|
231
|
+
#### [13.启动 funboost web manager,查看消费结果和队列管理](https://funboost.readthedocs.io/zh-cn/latest/articles/c13.html)
|
|
232
|
+
|
|
233
|
+
|
|
234
|
+
#### [funboost依赖的nb_log日志文档 https://nb-log-doc.readthedocs.io/zh_CN/latest/articles/c9.html#id2](https://nb-log-doc.readthedocs.io/zh_CN/latest/articles/c9.html#id2)
|
|
197
235
|
|
|
198
236
|
```
|
|
199
237
|
文档很长,但归根结底只需要学习 1.3 里面的这1个例子就行,主要是修改下@boost的各种参数,
|
|
@@ -238,7 +276,7 @@ pip install funboost --upgrade
|
|
|
238
276
|
|
|
239
277
|
## 1.2 框架功能介绍
|
|
240
278
|
|
|
241
|
-
分布式函数调度框架,支持5种并发模式,
|
|
279
|
+
分布式函数调度框架,支持5种并发模式,30+种消息中间件,30种任务控制功能。<br>
|
|
242
280
|
用途概念就是常规经典的 生产者 + 消息队列中间件 + 消费者 编程思想。
|
|
243
281
|
|
|
244
282
|
有了这个框架,用户再也无需亲自手写操作进程、线程、协程的并发的代码了。
|
|
@@ -465,6 +503,9 @@ python通用分布式函数调度框架。适用场景范围广泛, 框架非
|
|
|
465
503
|
funboost支持命令行操作:
|
|
466
504
|
使用fire实现的命令行,见文档第12章
|
|
467
505
|
|
|
506
|
+
可视化查看和操作:
|
|
507
|
+
funboost web manager 可以查看和管理队列和消费运行情况。
|
|
508
|
+
|
|
468
509
|
</pre>
|
|
469
510
|
|
|
470
511
|
|
|
@@ -530,7 +571,53 @@ if __name__ == "__main__":
|
|
|
530
571
|
<a href="https://imgse.com/i/pkFkCUe"><img src="https://s21.ax1x.com/2024/04/29/pkFkCUe.png" alt="pkFkCUe.png" border="0" /></a>
|
|
531
572
|
|
|
532
573
|
|
|
533
|
-
|
|
574
|
+
|
|
575
|
+
## 1.3.2 funboost丝滑连续启动多个函数消费
|
|
576
|
+
|
|
577
|
+
```python
|
|
578
|
+
|
|
579
|
+
"""
|
|
580
|
+
此代码
|
|
581
|
+
1.演示支持多个函数消费队列的无阻塞启动(consume不会阻塞主线程)
|
|
582
|
+
2.演示支持在一个消费函数内部向任意队列发布新任务,实现多级任务链
|
|
583
|
+
代码结构清晰,扩展性极强
|
|
584
|
+
"""
|
|
585
|
+
from funboost import boost, BrokerEnum,BoosterParams,ctrl_c_recv,ConcurrentModeEnum
|
|
586
|
+
import time
|
|
587
|
+
|
|
588
|
+
class MyBoosterParams(BoosterParams): # 自定义的参数类,继承BoosterParams,用于减少每个消费函数装饰器的重复相同入参个数
|
|
589
|
+
broker_kind: str = BrokerEnum.MEMORY_QUEUE
|
|
590
|
+
max_retry_times: int = 3
|
|
591
|
+
concurrent_mode: str = ConcurrentModeEnum.THREADING
|
|
592
|
+
|
|
593
|
+
|
|
594
|
+
@boost(MyBoosterParams(queue_name='s1_queue', qps=1, ))
|
|
595
|
+
def step1(a:int,b:int):
|
|
596
|
+
print(f'a={a},b={b}')
|
|
597
|
+
time.sleep(0.7)
|
|
598
|
+
for j in range(10):
|
|
599
|
+
step2.push(c=a+b +j,d=a*b +j,e=a-b +j ) # step1消费函数里面,也可以继续向其他任意队列发布消息。
|
|
600
|
+
return a+b
|
|
601
|
+
|
|
602
|
+
|
|
603
|
+
@boost(MyBoosterParams(queue_name='s2_queue', qps=3, ))
|
|
604
|
+
def step2(c:int,d:int,e:int):
|
|
605
|
+
time.sleep(3)
|
|
606
|
+
print(f'c={c},d={d},e={e}')
|
|
607
|
+
return c* d * e
|
|
608
|
+
|
|
609
|
+
|
|
610
|
+
if __name__ == '__main__':
|
|
611
|
+
for i in range(100):
|
|
612
|
+
step1.push(i,i*2) # 向 step1函数的队列发送消息。
|
|
613
|
+
step1.consume() # 调用.consume是非阻塞的启动消费,是在单独的子线程中循环拉取消息的。
|
|
614
|
+
# 有的人还担心阻塞而手动使用 threading.Thread(target=step1.consume).start() 来启动消费,这是完全多此一举的错误写法。
|
|
615
|
+
step2.consume() # 所以可以连续无阻塞丝滑的启动多个函数消费。
|
|
616
|
+
ctrl_c_recv()
|
|
617
|
+
|
|
618
|
+
```
|
|
619
|
+
|
|
620
|
+
## funboost web manager 截图:
|
|
534
621
|
|
|
535
622
|
函数消费结果:可查看和搜索函数实时消费状态和结果
|
|
536
623
|
[](https://imgse.com/i/pEJCffK)
|
|
@@ -543,13 +630,20 @@ funboost web manager 截图:
|
|
|
543
630
|
|
|
544
631
|
|
|
545
632
|
队列操作:查看和操作队列,包括 清空清空 暂停消费 恢复消费 调整qps和并发
|
|
546
|
-
[](https://imgse.com/i/pEJC6m9)
|
|
633
|
+
<!-- [](https://imgse.com/i/pEJC6m9) -->
|
|
634
|
+
[](https://imgse.com/i/pVSOJcq)
|
|
547
635
|
|
|
548
636
|
队列操作,查看消费者详情:查看队列的所有消费者详情
|
|
549
637
|
[](https://imgse.com/i/pEJCgT1)
|
|
550
638
|
|
|
551
|
-
|
|
552
|
-
[](https://imgse.com/i/pVpr7sP)
|
|
641
|
+
|
|
642
|
+
rpc调用:在网页上对30种消息队列发布消息并获取消息的函数执行结;根据taskid获取结果。
|
|
643
|
+
<!-- [](https://imgse.com/i/pETq8hj) -->
|
|
644
|
+
[](https://imgse.com/i/pE7y8oT)
|
|
645
|
+
|
|
646
|
+
|
|
553
647
|
|
|
554
648
|
## 1.4 python分布式函数执行为什么重要?
|
|
555
649
|
|