celery-task-specialist

Create Celery background tasks using the _run_async() pattern for gevent workers.

Updated Dec 16, 2025
One-click install
npx skills add https://github.com/adelabdelgawad/meal_request --skill celery-task-specialist
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: celery-task-specialist
Source: https://github.com/adelabdelgawad/meal_request/tree/main/.claude/skills/celery-task-specialist
Command: npx skills add https://github.com/adelabdelgawad/meal_request --skill celery-task-specialist

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps developers build robust Celery tasks that perform asynchronous database operations inside gevent-powered workers without running into event loop conflicts or resource leaks.

Core Features & Use Cases

  • Enforce the _run_async() helper pattern for all async Celery tasks to ensure correct event loop handling in gevent-based workers.
  • Support multi-database task patterns (MariaDB, HRIS SQL Server, BioStar MSSQL) with safe disposal of engines.
  • Provide execution tracking for APScheduler-triggered tasks, including status updates and error reporting.
  • Include robust retry strategies, timeouts, and structured logging for observability.
  • Example use case: Synchronize HRIS data into the local MariaDB while handling transient failures gracefully.

Quick Start

  • Create a new Celery task that uses the _run_async() wrapper inside the async _execute() function, declare result before the try block, dispose engines in finally, and return the result after finally.

Frequently Asked Questions about celery-task-specialist

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run async database operations in Celery gevent workers without event loop conflicts?

To run async database operations in Celery gevent workers without event loop conflicts, enforce the _run_async() helper pattern inside your task's async _execute() function to ensure deterministic execution and safe resource disposal.

What is the best way to handle multiple database connections in a Celery task?

The best way to handle multiple database connections in a Celery task is to use multi-database patterns for MariaDB, HRIS SQL Server, and BioStar MSSQL, ensuring you safely dispose of database engines in the finally block to prevent resource leaks.

How do I add execution tracking to APScheduler-triggered Celery tasks?

To add execution tracking to APScheduler-triggered Celery tasks, implement status updates and error reporting within your task logic, using structured logging to monitor the synchronization process and handle transient failures gracefully.

Why does my async Celery task fail when synchronizing data across multiple databases?

Your async Celery task fails because running async database operations directly inside gevent workers causes event loop conflicts. You must wrap your operations in the _run_async() pattern and declare the result before the try block to avoid execution errors.

Do I need to dispose of database engines manually in a Celery task?

Yes, you need to dispose of database engines manually in a Celery task by placing the disposal logic in the finally block. This ensures safe resource disposal and prevents connection leaks when handling multi-database operations like MariaDB and MSSQL.