async_interrupt
Interrupt context manager for asyncio.
This module provides a context manager that can be used to interrupt a block of code as soon as possible when a future is done.
The purpose is to raise as soon as possible to avoid any race conditions.
This is based loosely on async_timeout by Andrew Svetlov and cpython asyncio.timeout
Usage
async with interrupt(future, ValueError, "message"):
future.set_result(None)
await asyncio.sleep(0)
Installation
Install this via pip (or your favourite package manager):
pip install async_interrupt
Contributors ✨
Thanks goes to these wonderful people (emoji key):
This project follows the all-contributors specification. Contributions of any kind welcome!
Credits
This package was created with Copier and the browniebroke/pypackage-template project template.
Release files for async-interrupt 1.2.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| async_interrupt-1.2.2.tar.gz | 8.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| async_interrupt-1.2.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 17.4 kB
Release files / async_interrupt-1.2.2.tar.gz
| Download URL | async_interrupt-1.2.2.tar.gz |
|---|---|
| Size | 8.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
be4331a029b8625777905376a6dc1370984c8c810f30b79703f3ee039d262bf7
|
|
BLAKE2b-256 checksum How to use checksums |
5679732a581e3ceb09f938d33ad8ab3419856181d95bb621aa2441a10f281e10
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Feb 22, 2025.
Transparency logRelease files / async_interrupt-1.2.2-py3-none-any.whl
| Download URL | async_interrupt-1.2.2-py3-none-any.whl |
|---|---|
| Size | 8.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0a8deb884acfb5fe55188a693ae8a4381bbbd2cb6e670dac83869489513eec2c
|
|
BLAKE2b-256 checksum How to use checksums |
5a77060b972fa7819fa9eea9a70acf8c7c0c58341a1e300ee5ccb063e757a4a7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Feb 22, 2025.
Transparency log