You can protect a task from being canceled by wrapping it in a call to asyncio.shield(). In this tutorial, you will discover how to shield asyncio tasks from cancellation in Python. Let’s get started. What is Asyncio shield() The asyncio.shield() function wraps an awaitable in Future that will absorb requests to be canceled. Protect an […]
Published on November 26, 2022 10:00