---
name: "rq-redis-python-background-jobs"
description: "Manage simple, lightweight Python background job execution with Redis Queue."
metadata:
  author: "RQ"
  version: "1.0.0"
  runtime_compatibility:
    - "codex"
    - "claude-code"
    - "cursor"
    - "windsurf"
triggers:
  - "enqueue python job rq"
  - "configure rq retry and timeout"
  - "run rq worker"
permissions:
  fs_read: true
  fs_write: "workspace"
  shell_exec: false
  net_access: false
---

# RQ (Redis Queue) Lightweight Python Background Jobs

Implements background jobs using Python RQ: enqueueing functions, job timeouts, retry policies, failure callbacks, multi-queue prioritization, and monitoring via rq-dashboard.

## When to Invoke
Invoke this skill whenever you need to:
- enqueue python job rq
- configure rq retry and timeout
- run rq worker

## Execution SOP & Rules
1. Initialize queue: q = Queue('high', connection=redis_conn).
2. Enqueue task: job = q.enqueue(generate_pdf, user_id, job_timeout=300, retry=Retry(max=3)).
3. Start worker process: rq worker high default low --with-scheduler.
4. Inspect job status: job.get_status() and retrieve result with job.result once finished.

## Verification Checklist
- Run local linting, syntax validation, and type-checks before reporting completion.
- Ensure all created or modified files adhere to workspace boundaries and avoid uncommitted secrets.
- Verify tests or build commands exit cleanly with return code 0.
