cancellation-tokens-ai-kit

Community

Propagate cancellation safely across .NET async

Authorducthang-hub
Version1.0.0
Installs0

System Documentation

What problem does it solve?

It helps you implement reliable cancellation in .NET so long-running, async, and request-scoped operations stop promptly without leaving your app in an inconsistent state.

Core Features & Use Cases

  • Request-scoped cancellation: Use HttpContext.RequestAborted as the upstream CancellationToken for web endpoints.
  • Correct propagation: Pass the same CancellationToken through controllers, services, repositories, and EF Core async calls.
  • Loop and background safety: Check IsCancellationRequested or call ThrowIfCancellationRequested inside long-running loops and handle OperationCanceledException appropriately.

Quick Start

Use the cancellation-tokens-ai-kit skill to show you how to wire HttpContext.RequestAborted into your controller and propagate the token down to your EF Core queries and background loops.

Dependency Matrix

Required Modules

None required

Components

Standard package

💻 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: cancellation-tokens-ai-kit
Download link: https://github.com/ducthang-hub/nw-ai-kit/archive/main.zip#cancellation-tokens-ai-kit

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 471,000+ vetted skills library on demand.