https://github.com/aio-libs/aiolibs-executor
Executor implementation for asyncio
https://github.com/aio-libs/aiolibs-executor
Last synced: 6 months ago
JSON representation
Executor implementation for asyncio
- Host: GitHub
- URL: https://github.com/aio-libs/aiolibs-executor
- Owner: aio-libs
- License: apache-2.0
- Created: 2025-02-10T12:38:13.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2025-06-23T04:35:23.000Z (7 months ago)
- Last Synced: 2025-06-27T13:47:52.753Z (7 months ago)
- Language: Python
- Size: 64.5 KB
- Stars: 17
- Watchers: 8
- Forks: 1
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# aiolibs-executor
Asyncio version of `concurrent.futures` executor.
## Installaion
`pip install aiolibs-executor`
## Usage
```
from aiolibs_executor import Executor
async def worker(arg):
return await do_stuff(arg)
async with Executor(num_workers=3) as executor:
futs = [await executor.submit(worker(i)) for i in range(10)]
for fut in futs:
print(await fut)
```
All submitted `worker(i)` coroutines are distributed to three concurrent streams,
awaiting returned functions provides a value returned by a coroutine.
TODO: Make comprehensive description of all public `Executor`'s methods.
## License
The library is published under Apache 2.0 license.