Skip to main content
# 使用指南

1、pip install pyengine

2、运行命令 pyengine run -d 缓存目录 -p 端口号 -n 可同时处理的请求数量

3、接口
/run/
body 体为一个FuncClass的子类


```python
from pyengine import FuncClass
import time
class My2(FuncClass):
def run(self):
print('MY is Running')
time.sleep(1)
return "你好啊!"
```

返回结果为

```json
{
"res": "你好啊!"
}
```

/add/

增加n的个数

/reduce/

减少n的个数

4、新增一个异步装饰器

```python
from pyengine import async_work_res,async_work
def deal_res(res):
print('res')

@async_work_res(deal_res)
def work():
return '大家好!'

@async_work
def work():
return '大家好!'
```

可以使被装饰的函数启动一个进程或者线程去执行(在win下启动线程,在linux下启动进程),该装饰器的参数是一个可以处理被装饰的函数的结果

5 、异步方法改进

​ 0.0.4

​ 进程开启方法改进,进程退出方法改进

​ 僵尸进程处理

Release files for pyengine 0.0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyengine 0.0.4
File Size Uploaded
pyengine-0.0.4.tar.gz 3.4 kB Details

Release files / pyengine-0.0.4.tar.gz

Download URL pyengine-0.0.4.tar.gz
Size 3.4 kB
Tags Source
SHA-256 checksum
How to use checksums
7bdcee6054e8a92daefc59d9b049771d8cbfc056155233ebd32fd890a3c1602e
BLAKE2b-256 checksum
How to use checksums
8b351325a5c8773b98ddc1030132673f25c1e8bdad2f04991c578571fcadb863
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.0

Release history Release notifications | RSS feed

This release

0.0.4 This release

1 release file

0.0.3

1 release file

0.0.2

1 release file

0.0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page