Skip to main content

async_interrupt

CI Status Test coverage percentage

Poetry black pre-commit

PyPI Version Supported Python versions License

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)

Source distribution for async-interrupt 1.2.2
File Size Uploaded
async_interrupt-1.2.2.tar.gz 8.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for async-interrupt 1.2.2
File Interpreter ABI Platform
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 log

Release 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

Release history Release notifications | RSS feed

This release

1.2.2 This release

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.1.0

2 release files

0.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page