Collection of utilities to write safe asyncio code.
Project description
asynchrony
Python asyncio framework for writing safe and fast concurrent code.
Features:
- Type annotated and type safe
- Makes it easy to work with cancellation, errors, and scheduling.
- Well tested and well documented.
- Zero dependency.
- Based on real world experience and pain.
Installation and usage
python3 -m pip install asynchrony
A simple example of starting 100 tasks concurrently and waiting for all of them to finish:
from asynchrony import Tasks
async def download_page(url: str) -> bytes:
...
tasks = Tasks[bytes](timeout=10, max_concurrency=100)
for url in URLS:
tasks.start(download_page(url))
pages = await tasks
See tutorial for runnable usage examples.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
asynchrony-0.1.0.tar.gz
(10.8 kB
view hashes)
Built Distribution
Close
Hashes for asynchrony-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dda4c692c43b8eabd4f612044b17438c7e9f4cfb15fc2a280ef0dd060963a785 |
|
MD5 | 01d40b1975dcb338faa4aa669486f0c5 |
|
BLAKE2b-256 | 56b78b8d738d16372973f811d7388f38aa6bfe9f8946fddf69c4671eeb8cfc28 |