Path: csiph.com!fu-berlin.de!bofh.it!news.nic.it!robomod From: Edward Betts Newsgroups: linux.debian.bugs.dist,linux.debian.devel,linux.debian.maint.python Subject: Bug#1071442: ITP: python-async-interrupt -- Interrupt context manager for asyncio Date: Sun, 19 May 2024 14:30:01 +0200 Message-ID: X-Original-To: Debian Bug Tracking System X-Mailbox-Line: From debian-bugs-dist-request@lists.debian.org Sun May 19 12:21:09 2024 Old-Return-Path: X-Spam-Flag: NO X-Spam-Score: 1.2 Reply-To: Edward Betts , 1071442@bugs.debian.org Resent-To: debian-bugs-dist@lists.debian.org Resent-Cc: debian-devel@lists.debian.org, debian-python@lists.debian.org, wnpp@debian.org X-Debian-Pr-Message: report 1071442 X-Debian-Pr-Package: wnpp MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Debian-Message: from BTS X-Mailing-List: archive/latest/1838311 List-ID: List-URL: Approved: robomod@news.nic.it Lines: 30 Organization: linux.* mail to news gateway Sender: robomod@news.nic.it X-Original-Date: Sun, 19 May 2024 13:19:13 +0100 X-Original-Message-ID: Xref: csiph.com linux.debian.bugs.dist:1197920 linux.debian.devel:111805 linux.debian.maint.python:15844 Package: wnpp Severity: wishlist Owner: Edward Betts X-Debbugs-Cc: debian-devel@lists.debian.org, debian-python@lists.debian.org * Package name : python-async-interrupt Version : 1.1.1 Upstream Author : J. Nick Koston * URL : https://github.com/bdraco/async_interrupt * License : Apache-2.0 Programming Lang: Python Description : Interrupt context manager for asyncio This Python 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 of async_interrupt is to raise an exception as soon as possible to avoid any race conditions. It 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) . This package is useful in scenarios where an exception needs to be raised immediately to prevent race conditions during asynchronous operations. I plan to maintain this package as part of the Python team.