Async Background Task Error Handling

Community

Persist task terminal states to avoid loading.

Authorhaiweiliu
Version1.0.0
Installs0

System Documentation

What problem does it solve?

Frontend polling can end up in an endless loading state when background tasks crash, time out, or fail to write results. This Skill enforces a robust pattern that guarantees terminal task states are persisted to the database, ensuring the UI can stop polling and render a proper outcome.

Core Features & Use Cases

  • Persist terminal states for all background tasks (completed or failed).
  • Use a safe wrapper to guarantee a database write even when the task encounters errors.
  • Enable frontend polling to reliably react to 'completed' or 'failed' states and surface results or errors.

Quick Start

Configure your safeBackgroundTask wrapper to always persist the task state and update the frontend polling to react to 'completed' or 'failed' states.

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: Async Background Task Error Handling
Download link: https://github.com/haiweiliu/trafficlens/archive/main.zip#async-background-task-error-handling

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.