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:
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.
Release files for Awaitable 0.2.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| Awaitable-0.2.3.tar.gz | 4.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| Awaitable-0.2.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 11.3 kB
Release files / Awaitable-0.2.3.tar.gz
| Download URL | Awaitable-0.2.3.tar.gz |
|---|---|
| Size | 4.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c84cb7fb04906ad0e9a8ad0788956e04334bd9be63600ee1504a6a1f75a1b723
|
|
BLAKE2b-256 checksum How to use checksums |
e5c6285c10e9ffb8cf7be8f8bb7c16534b0d1343bac04c89a5ccfd4f81d8e7fc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.7
|
Release files / Awaitable-0.2.3-py3-none-any.whl
| Download URL | Awaitable-0.2.3-py3-none-any.whl |
|---|---|
| Size | 7.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9d8986f4778ea43b204d3653e59220a2f08a23bb6d0523c525615550dd65c1fd
|
|
BLAKE2b-256 checksum How to use checksums |
56cd63c9ea91dff5b3ea3fef4381c627f869ad760ee5f0c28a3483fef38595a2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.7
|