Some convenient utilities for asyncio
Project description
asyncio-addon
Some convenient utilities for asyncio.
Utilities include:
@async_main: A decorator to run an async function as the main entry point.run_sync: Run a coroutine in sync, even if the async event loop is running.run_async: An alias ofasyncio.to_thread. Run a sync function in a separate thread.SemGroup: A task group with a semaphore, allowing limited concurrency.gather_all: Enhanced version ofasyncio.gatherwith concurrency control, better API and cancel-safety.
(Almost) everything natively include timeout control.
Why do we need another gather_all?
As the doc says:
A new alternative to create and run tasks concurrently and wait for their completion is asyncio.TaskGroup. TaskGroup provides stronger safety guarantees than gather for scheduling a nesting of subtasks: if a task (or a subtask, a task scheduled by a task) raises an exception, TaskGroup will, while gather will not, cancel the remaining scheduled tasks.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file asyncio_addon-0.3.0.tar.gz.
File metadata
- Download URL: asyncio_addon-0.3.0.tar.gz
- Upload date:
- Size: 7.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
22d19dcf8b8a9b1896e69eff3f7f4da4b73dc8f86613b862492921c4f5bdab18
|
|
| MD5 |
3a78bca532665ee53d888e3d48092069
|
|
| BLAKE2b-256 |
3efcc677c78922a0e2bc994a1833357460b733f82d036ed5fe551bc6fb74de01
|
Provenance
The following attestation bundles were made for asyncio_addon-0.3.0.tar.gz:
Publisher:
publish-to-pypi.yml on observerw/asyncio-addon
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
asyncio_addon-0.3.0.tar.gz -
Subject digest:
22d19dcf8b8a9b1896e69eff3f7f4da4b73dc8f86613b862492921c4f5bdab18 - Sigstore transparency entry: 264131485
- Sigstore integration time:
-
Permalink:
observerw/asyncio-addon@9878aea57ef5bb9043fda86eeabc7d62ae293dd0 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/observerw
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@9878aea57ef5bb9043fda86eeabc7d62ae293dd0 -
Trigger Event:
push
-
Statement type:
File details
Details for the file asyncio_addon-0.3.0-py3-none-any.whl.
File metadata
- Download URL: asyncio_addon-0.3.0-py3-none-any.whl
- Upload date:
- Size: 5.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
447c9fcf80d9dbd28de7aa49901b06a6b5c26275cc7ee3e0f163d17ea55f8ff8
|
|
| MD5 |
3475ea26ca4ee7113ce0ba61e8b8c642
|
|
| BLAKE2b-256 |
5c32459f435e56a0e1b05beeda41c5f6813a8783f97990720e9e8b6b170bb90e
|
Provenance
The following attestation bundles were made for asyncio_addon-0.3.0-py3-none-any.whl:
Publisher:
publish-to-pypi.yml on observerw/asyncio-addon
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
asyncio_addon-0.3.0-py3-none-any.whl -
Subject digest:
447c9fcf80d9dbd28de7aa49901b06a6b5c26275cc7ee3e0f163d17ea55f8ff8 - Sigstore transparency entry: 264131487
- Sigstore integration time:
-
Permalink:
observerw/asyncio-addon@9878aea57ef5bb9043fda86eeabc7d62ae293dd0 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/observerw
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@9878aea57ef5bb9043fda86eeabc7d62ae293dd0 -
Trigger Event:
push
-
Statement type: