脚本管理器
ramjet的Python项目详细描述
冲压发动机[版本](https://img.shields.io/badge/version-v1.8.1-blue.svg)](
[![PYPI版本](https://badge.fury.io/py/ramjet.svg)(https://badge.fury.io/py/ramjet)
[![版本](https://img.shields.io/badge/license mit/apache blue.svg)](
[![易混合](https://img.shields.io/badge/commitizen-friendly brightgreen.svg)(http://commitizen.github.io/cz cli/)
>;_12364;24449;_26143;--yang wen li
![](http://7xjvpy.dl1.z0.glb.clouddn.com/ramjet.jpg) |
|:--:|
| 后台脚本的引擎 |
## Links
- [Documents](http://laisky.github.io/ramjet/)
- [Github](https://github.com/Laisky/ramjet)
- [PyPI](https://pypi.python.org/pypi/ramjet)
## Install &
>需要python3.5.x.
``sh
`从pypi安装从pypi安装到ramjet
`从pypi安装ramjet
``` ` `
` ` ` ` ` ` ` ` ` ` ` ` ` sh sh
` ` ` ` ` ` ` ` ` ` ` ` ` ` ` `
` ` ` ` ` ` ` ` ` ` ` ` ` ` ` `异步电流期货运行脚本(`tasks`)。
每一个 task 都需要实现接口 `bind_task()`。
利用 `ioloop`、`thread_executor`、`process_executor` 自行实现运行逻辑。
## Demo
### 异步
```py
import random
import asyncio
from ramjet.engines import process_executor, 线程执行器,
>defind-bu task():
/>
异步定义异步子任务(n):
等待asyncio.sleep(random.random())
print('子任务{}确定!'.format(n))
```
### 多线程 & 多进程
需要注意子进程没法回收,所以请确保 task 可以很好的结束。
```py
from ramjet.engines import process_executor, thread_executor, ioloop
def bind_task():
# 多线程
thread_executor.submit(task, 你的参数)
ioloop
def bind_task():
delay=3600
ioloop.call_later(delay,task,your_auguments)
def task(*args,**kw):
**kw)
`````
````py
``从aiohttp导入网站
``从ramjet.settings导入日志
logger=logger.getchild('tasks.web\u-demo')
defind-bind-bind-handle(添加defind-bind-bind-bind-handle(添加defin_route):
添加_route('/',demohandle)
返回web.response(text=“new hope”)
`````
[![PYPI版本](https://badge.fury.io/py/ramjet.svg)(https://badge.fury.io/py/ramjet)
[![版本](https://img.shields.io/badge/license mit/apache blue.svg)](
[![易混合](https://img.shields.io/badge/commitizen-friendly brightgreen.svg)(http://commitizen.github.io/cz cli/)
>;_12364;24449;_26143;--yang wen li
![](http://7xjvpy.dl1.z0.glb.clouddn.com/ramjet.jpg) |
|:--:|
| 后台脚本的引擎 |
## Links
- [Documents](http://laisky.github.io/ramjet/)
- [Github](https://github.com/Laisky/ramjet)
- [PyPI](https://pypi.python.org/pypi/ramjet)
## Install &
>需要python3.5.x.
``sh
`从pypi安装从pypi安装到ramjet
`从pypi安装ramjet
``` ` `
` ` ` ` ` ` ` ` ` ` ` ` ` sh sh
` ` ` ` ` ` ` ` ` ` ` ` ` ` ` `
` ` ` ` ` ` ` ` ` ` ` ` ` ` ` `异步电流期货运行脚本(`tasks`)。
每一个 task 都需要实现接口 `bind_task()`。
利用 `ioloop`、`thread_executor`、`process_executor` 自行实现运行逻辑。
## Demo
### 异步
```py
import random
import asyncio
from ramjet.engines import process_executor, 线程执行器,
>defind-bu task():
/>
异步定义异步子任务(n):
等待asyncio.sleep(random.random())
print('子任务{}确定!'.format(n))
```
### 多线程 & 多进程
需要注意子进程没法回收,所以请确保 task 可以很好的结束。
```py
from ramjet.engines import process_executor, thread_executor, ioloop
def bind_task():
# 多线程
thread_executor.submit(task, 你的参数)
ioloop
def bind_task():
delay=3600
ioloop.call_later(delay,task,your_auguments)
def task(*args,**kw):
**kw)
`````
````py
``从aiohttp导入网站
``从ramjet.settings导入日志
logger=logger.getchild('tasks.web\u-demo')
defind-bind-bind-handle(添加defind-bind-bind-bind-handle(添加defin_route):
添加_route('/',demohandle)
`````