cancel-async-tasks

Community

Gracefully cancel asyncio tasks.

AuthorZurybr
Version1.0.0
Installs0

System Documentation

What problem does it solve?

This Skill addresses the complex challenge of reliably cancelling asynchronous Python tasks, especially when dealing with external signals like keyboard interrupts (Ctrl+C), ensuring that critical cleanup operations are performed.

Core Features & Use Cases

  • Robust Cancellation: Provides strategies for handling asyncio.CancelledError within coroutines.
  • Signal Handling: Guides on integrating signal handlers (SIGINT, SIGTERM) for graceful shutdown.
  • Cleanup Assurance: Emphasizes patterns to ensure resources are released and state is consistent upon cancellation.
  • Use Case: When running a long-lived asyncio application that needs to shut down cleanly when the user presses Ctrl+C, this skill provides the necessary patterns to catch the interrupt, cancel all running tasks, and execute finalization logic.

Quick Start

Implement asyncio task cancellation with proper cleanup by catching asyncio.CancelledError in your coroutines.

Dependency Matrix

Required Modules

None required

Components

references

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: cancel-async-tasks
Download link: https://github.com/Zurybr/lefarma-skills/archive/main.zip#cancel-async-tasks

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 223,000+ vetted skills library on demand.