Task Scheduling
一个强大的 Python 任务调度库,提供灵活的任务管理和调度功能。
支持系统:可以安装python的所有系统
特性
- 🚀 简单易用的任务创建和管理
- ⏰ 灵活的定时调度策略,目前的版本会造成微小的运行时间增加
- 🔄 支持任务重试和依赖管理
- 🌐 内置 Web 控制界面
- 🧵 支持线程级任务执行
- 🌳 任务树模式支持
- 🔗 分布式服务支持
- 📊 实时状态监控和结果查询
文档
完整使用说明和完整功能介绍请查看: https://fallingmeteorite.github.io/task_scheduling/
快速开始
安装
pip install --upgrade task_scheduling
基本使用
import time
from task_scheduling.variable import *
from task_scheduling.utils import interruptible_sleep
def linear_task(input_info):
for i in range(10):
interruptible_sleep(1)
print(f"Linear task: {input_info} - {i}")
if __name__ == "__main__":
from task_scheduling.task_creation import task_creation
from task_scheduling.manager import task_scheduler
task_id1 = task_creation(
None, None, FUNCTION_TYPE_IO, True, "linear_task",
linear_task, priority_low, "Hello Linear"
)
while True:
try:
time.sleep(0.1)
except KeyboardInterrupt:
task_scheduler.shutdown_scheduler()
感谢
https://github.com/glenfant/stopit
感谢这个库给予我了一个很巧妙地思维去处理任务控制相关的逻辑
为了便于后续修改我将它放在库内部,而不是通过 pip 安装的,所以这里明确说明并感谢
许可证
MIT License
贡献
欢迎提交 Issue 和 Pull Request!
Release files for task-scheduling 6.6.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| task_scheduling-6.6.0.tar.gz | 74.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| task_scheduling-6.6.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 188.7 kB
Release files / task_scheduling-6.6.0.tar.gz
| Download URL | task_scheduling-6.6.0.tar.gz |
|---|---|
| Size | 74.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b1ca4629e2c628601c31330b49024506edc7621c056b1de3143cca35f08131a1
|
|
BLAKE2b-256 checksum How to use checksums |
7f1d11efb07dbc3aae5a66be4e1ff6bc7c008af7a7dd5d9ec59dba8a76942ca0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.6
|
Release files / task_scheduling-6.6.0-py3-none-any.whl
| Download URL | task_scheduling-6.6.0-py3-none-any.whl |
|---|---|
| Size | 114.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1239c939d9dd0877e3a97bf8122fd6d612a1a2d9bc7773fc6799372e73e5e2c7
|
|
BLAKE2b-256 checksum How to use checksums |
92b4ecb4825b82f20d1eaba0e47905e2303e8c1c769c313fcd8c2136e59e2756
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.6
|