Awaitable-0.2.3
توضیحات
A decorator to asynchronously execute synchronous functions
| ویژگی | مقدار |
|---|---|
| سیستم عامل | OS Independent |
| نام فایل | Awaitable-0.2.3 |
| نام | Awaitable |
| نسخه کتابخانه | 0.2.3 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Fabio Castelli |
| ایمیل نویسنده | muflone@muflone.com |
| آدرس صفحه اصلی | http://www.muflone.com/awaitable/ |
| آدرس اینترنتی | https://pypi.org/project/Awaitable/ |
| مجوز | GPLv3+ |
# Awaitable
[](https://www.travis-ci.com/github/muflone/awaitable)
[](https://circleci.com/gh/muflone/awaitable)
[](https://pypi.org/project/Awaitable/)
[](https://pypi.org/project/Awaitable/)
**Description:** A decorator to asynchronously execute synchronous functions
**Copyright:** 2022 Fabio Castelli (Muflone) <muflone@muflone.com>
**License:** GPL-3+
**Source code:** https://github.com/muflone/awaitable
**Documentation:** http://www.muflone.com/awaitable/
# Description
Awaitable is a small decorator to asynchronously execute synchronous functions.
# System Requirements
* Python 3.x
# Usage
You can decorate a synchronous routine using `@awaitable.awaitable` to make it
awaitable and `awaitable.AsyncioGather` to process some tasks using asyncio:
```python
import awaitable
@awaitable.awaitable
def do_something():
# process a single task
return
async def process(count):
# execute some workers
tasks = awaitable.AsyncioGather()
for i in range(count):
tasks.add(do_something())
await tasks.run()
awaitable.run_awaitable(func=process, count=10)
```
Please see the **samples** folders for some others usage examples.
نحوه نصب
نصب پکیج whl Awaitable-0.2.3:
pip install Awaitable-0.2.3.whl
نصب پکیج tar.gz Awaitable-0.2.3:
pip install Awaitable-0.2.3.tar.gz