{"categories":[{"label":"Libraries","url":"https://skillfed.io/packages/category/software-development-libraries/4"}],"enrichment":{"capability":"Provides an asyncio context manager that interrupts a block of code and raises an exception when a future completes, designed to minimize race conditions.","skillfed_tags":["asyncio","context-manager","concurrency"],"use_cases":["Cancel long-running async operations when an external signal (represented as a future) fires.","Implement custom timeout or deadline logic by raising an exception tied to a future's completion.","Coordinate async task interruption across multiple coroutines without race conditions.","Build async state machines that respond to external events by raising controlled exceptions."],"what_it_does":"async_interrupt is a lightweight asyncio utility that provides a context manager for raising an exception as soon as a future completes. It wraps a code block and monitors a supplied future; when that future is done, the context manager raises a specified exception with an optional message. The design prioritizes minimizing race conditions by raising as promptly as possible.\n\nThe package has no runtime dependencies and is built for modern Python versions (3.9\u20133.13). It draws inspiration from async_timeout and cpython's asyncio.timeout, making it a focused alternative for scenarios where you need fine-grained control over future-based interruption. With active maintenance and a permissive Apache-2.0 license, it is production-ready for integration into async workflows.","worth_installing":"Yes. The package is lightweight, actively maintained, has no dependencies, supports current Python versions, carries no known vulnerabilities, and solves a specific asyncio coordination problem with a permissive license. Install it if you need future-based interruption with minimal race-condition risk."},"id":"async-interrupt","links":{"html":"https://skillfed.io/packages/async-interrupt","md":"https://skillfed.io/packages/async-interrupt.md","pypi":"https://pypi.org/project/async-interrupt/"},"maintenance":{"status":"active"},"meta":{"latest_release":"2025-02-22","license_spdx":null,"license_treatment":"permissive","name":"async-interrupt","python_support":"supports_current","summary":"Context manager to raise an exception when a future is done"},"popularity":{"monthly_downloads":907830,"position":4756,"tier":"top_5000"},"security":{"n_vulnerabilities":0},"version":"1.2.2"}
