https://github.com/python-tools/aio_parallel_tools
异步并行工具
https://github.com/python-tools/aio_parallel_tools
Last synced: 4 days ago
JSON representation
异步并行工具
- Host: GitHub
- URL: https://github.com/python-tools/aio_parallel_tools
- Owner: Python-Tools
- License: mit
- Created: 2019-10-30T13:52:35.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2022-07-06T20:22:25.000Z (over 3 years ago)
- Last Synced: 2025-02-18T15:19:54.424Z (about 1 year ago)
- Language: HTML
- Size: 1.4 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Welcome to aio parallel tools's documentation
+ version: 0.0.1
+ status: dev
+ author: huangsizhe
+ email: hsz1273327@gmail.com
## Desc
Tools for creating asynchronous scripts easily.
keywords: tools,asyncio
## Feature
+ Task pool
+ Actor and Actor Manager
## Example
```python
async with AioFixedTaskPoolSimple() as task_pool:
print(f"test pool size {task_pool.size}")
print("test 4 task with pool size 3")
await asyncio.gather(
task_pool.submit(test, func_args=["c"]),
task_pool.submit(test, func_args=["b"]),
task_pool.submit(test, func_args=["a"]),
task_pool.submit(test, func_args=["d"])
)
class Pinger(AioActor):
async def receive(self, message):
print(message)
try:
await ActorManager.get_actor("Ponger").Send('ping')
except Exception as e:
print(f"receive run error {e}")
finally:
await asyncio.sleep(0.5)
```
## Install
`python -m pip install aio_parallel_tools`
## Document
## Change Log
### version 0.0.1
+ created this project