Skip to content

Commit

Permalink
doc
Browse files Browse the repository at this point in the history
  • Loading branch information
fcfangcc committed Jun 9, 2022
1 parent bcfc291 commit a5cb714
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 8 deletions.
48 changes: 41 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,53 @@

使用pyxxl可以方便的把Python写的方法注册到xxl-job中,使用xxl-job-admin管理Python定时任务和周期任务

## 已经支持的功能

* 执行器注册到job-admin
* task注册,类似于flask路由装饰器的用法
* 任务的管理(支持在界面上取消,发起等操作,任务完成后会回调admin)
* 所有阻塞策略的支持
* 异步支持(推荐)

## 待实现

- [x] 自定义日志 和 界面上查看日志

## 如何使用

```shell
pip install pyxxl
```

使用示例 [example](https://fcfangcc.github.io/pyxxl/example/) ,具体代码在example文件夹下面
```
import asyncio
from pyxxl import PyxxlRunner
app = PyxxlRunner(
"http://localhost:8080/xxl-job-admin/api/",
executor_name="xxl-job-executor-sample",
port=9999,
host="172.17.0.1",
)
@app.handler.register(name="demoJobHandler")
async def test_task():
await asyncio.sleep(5)
return "成功..."
@app.handler.register(name="xxxxx")
async def test_task3():
await asyncio.sleep(3)
return "成功3"
app.run_executor()
```


更多示例和接口文档请参考 [PYXXL文档](https://fcfangcc.github.io/pyxxl/example/) ,具体代码在example文件夹下面


## 开发人员
Expand All @@ -41,9 +81,3 @@ poetry install
# 修改app.py中相关的配置信息,然后启动
poetry run python example/app.py
```



## TODOs
- [x] 自定义查看日志函数
- [-] docs
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "pyxxl"
version = "0.1.5"
version = "0.1.6"
readme = "README.md"
license = "GPL-3.0-only"
description = "A Python executor for XXL-jobs"
Expand Down

0 comments on commit a5cb714

Please sign in to comment.