Command Palette

Search for a command to run...

Назад к скиллам
скилл № 01208

async-jobs

Async job processing patterns for background tasks, Celery workflows, task scheduling, retry strategies, and distributed task execution. Use when implementing…

БесплатноБез исполняемых скриптов
diegosouzapwот diegosouzapw★ 68 звёзд на GitHub

Установить async-jobs в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Об этом скилле

Async Jobs

Patterns for background task processing with Celery, ARQ, and Redis. Covers task queues, canvas workflows, scheduling, retry strategies, rate limiting, and production monitoring. Each category has individual rule files in references/ loaded on-demand.

Quick Reference

Category Rules Impact When to Use
Configuration celery-config HIGH Celery app setup, broker, serialization, worker tuning
Task Routing task-routing HIGH Priority queues, multi-queue workers, dynamic routing
Canvas Workflows canvas-workflows HIGH Chain, group, chord, nested workflows
Retry Strategies retry-strategies HIGH Exponential backoff, idempotency, dead letter queues
Scheduling scheduled-tasks MEDIUM Celery Beat, crontab, database-backed schedules
Monitoring monitoring-health MEDIUM Flower, custom events, health checks, metrics
Result Backends result-backends MEDIUM Redis results, custom states, progress tracking
ARQ Patterns arq-patterns MEDIUM Async Redis Queue for FastAPI, lightweight jobs
Temporal Workflows temporal-workflows HIGH Durable workflow definitions, sagas, signals, queries
Temporal Activities temporal-activities HIGH Activity patterns, workers, heartbeats, testing

Total: 10 rules across 9 categories

Quick Start

# Celery task with retry
from celery import shared_task

@shared_task(
    bind=True,
    max_retries=3,
    autoretry_for=(ConnectionError, TimeoutError),
    retry_backoff=True,
)
def process_order(self, order_id: str) -> dict:
    result = do_processing(order_id)
    return {"order_id": order_id, "status": "completed"}
# ARQ task with FastAPI
from arq import create_pool
from arq.connections import RedisSettings

async def generate_report(ctx: dict, report_id: str) -> dict:
    data = await ctx["db"].fetch_report_data(report_id)
    pdf = await render_pdf(data)
    return {"report_id": report_id, "size": len(pdf)}

@router.post("/api/v1/reports")
async def create_report(data: ReportRequest, arq: ArqRedis = Depends(get_arq_pool)):
    job = await arq.enqueue_job("generate_report", data.report_id)
    return {"job_id": job.job_id}

Configuration

Production Celery app configuration with secure defaults and worker tuning.

Key Patterns

  • JSON serialization with task_serializer="json" for safety
  • Late acknowledgment with task_acks_late=True to prevent task loss on crash
  • Time limits with both task_time_limit (hard) and task_soft_time_limit (soft)
  • Fair distribution with worker_prefetch_multiplier=1
  • Reject on lost with task_reject_on_worker_lost=True

Key Decisions

Decision Recommendation
Serializer JSON (never pickle)
Ack mode Late ack (task_acks_late=True)
Prefetch 1 for fair, 4-8 for throughput
Time limit soft < hard (e.g., 540/600)
Timezone UTC always

Task Routing

Priority queue configuration with multi-queue workers and dynamic routing.

Key Patterns

  • Named queues for critical/high/default/low/bulk separation
  • Redis priority with queue_order_strategy: "priority" and 0-9 levels
  • Task router classes for dynamic routing based on task attributes
  • Per-queue workers with tuned concurrency and prefetch settings
  • Content-based routing for dynamic workflow dispatch

Key Decisions

Decision Recommendation
Queue count 3-5 (critical/high/default/low/bulk)
Priority levels 0-9 with Redis x-max-priority
Worker assignment Dedicated workers per queue
Prefetch 1 for critical, 4-8 for bulk
Routing Router class for 5+ routing rules

Canvas Workflows

Celery canvas primitives for sequential, parallel, and fan-in/fan-out workflows.

Key Patterns

  • Chain for sequential ETL pipelines with result passing
  • Group for parallel execution of independent tasks
  • Chord for fan-out/fan-in with aggregation callback
  • Immutable signatures (si()) for steps that ignore input
  • Nested workflows combining groups inside chains
  • Link error callbacks for workflow-level error handling

Key Decisions

Decision Recommendation
Sequential Chain with s()
Parallel Group for independent tasks
Fan-in Chord (all must succeed for callback)
Ignore input Use si() immutable signature
Error in chain Reject stops chain, retry continues
Partial failures Return error dict in chord tasks

Retry Strategies

Retry patterns with exponential backoff, idempotency, and dead letter queues.

Key Patterns

  • Exponential backoff with `retry
Полный SKILL.md на GitHub

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

  • metadata.json

FAQ

Что делает скилл async-jobs?

Async job processing patterns for background tasks, Celery workflows, task scheduling, retry strategies, and distributed task execution. Use when implementing background job processing, task queues, or scheduled task systems.

Как установить скилл async-jobs?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл async-jobs запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить async-jobs с