Before You Build
Block No Verify
Brand Landingpage
Business Analytics
Database Design
Documentation Generation
Documentation Standards
File Conversion
Framework Migration
Frontend Mobile Development
Game Development
Hermes Tweet
Hr Legal Compliance
Incident Response
Kubernetes Operations
Machine Learning Ops
NET Contribution
Observability Monitoring
Payment Processing
Plugin Eval
Protect MCP
Python Development · Python…
Quantitative Trading
Review Agent Governance
Ship Mate
Signed Audit Trails
Skill Forge Essentials
Social Publishing
Systems Programming
180 chapters · 328 min
Python Development
Chapter 129 of 180
Python background job patterns including task queues, workers, and event-driven architecture.
2 minutes · 362 words · 15 sections
Decouple long-running or unreliable work from request/response cycles. Return immediately to the user while background workers handle the heavy lifting asynchronously.
API accepts request, enqueues a job, returns immediately with a job ID. Workers process jobs asynchronously.
Tasks may be retried on failure. Design for safe re-execution.
Jobs transition through states: pending → running → succeeded/failed.
Most queues guarantee at-least-once delivery. Your code must handle duplicates.
This skill uses Celery for examples, a widely adopted task queue. Alternatives like RQ, Dramatiq, and cloud-native solutions (AWS SQS, GCP Tasks) are equally valid choices.
from celery import Celery
app = Celery("tasks", broker="redis://localhost:6379")
@app.task
def send_email(to: str, subject: str, body: str) -> None:
# This runs in a background worker
email_client.send(to, subject, body)
# In your API handler
send_email.delay("user@example.com", For operations exceeding a few seconds, return a job ID and process asynchronously.
from uuid import uuid4
from dataclasses import dataclass
from enum import Enum
from datetime import datetime
class JobStatus(Enum):
PENDING = "pending"
Configure Celery tasks with proper retry and timeout settings.
from celery import Celery
app = Celery("tasks", broker="redis://localhost:6379")
# Global configuration
app.conf.update(
task_time_limit=3600, # Hard limit: 1 hour
task_soft_time_limit=3000
Workers may retry on crash or timeout. Design for safe re-execution.
@app.task(bind=True)
def process_order(self, order_id: str) -> None:
"""Process order idempotently."""
order = orders_repo.get(order_id)
# Already processed? Return early
if order.status == OrderStatus.COMPLETED:
logger.info("Order already processed",
Idempotency Strategies:
INSERT ... ON CONFLICT UPDATEPersist job state transitions for visibility and debugging.
class JobRepository:
"""Repository for managing job state."""
async def create(self, job: Job) -> Job:
"""Create new job record."""
await self._db.execute(
"""INSERT INTO jobs (id, status, created_at)
VALUES ($1, $2, $3)""",
job.id, job.status.value, job.created_at,
)
return job
Detailed sections (starting with ## Advanced Patterns) live in references/details.md. Read that file when the navigation summary above is insufficient.
Install this repository
npx skills add wshobson/agents/plugin marketplace add wshobson/agentsSkills install per repository, not per chapter — the CLI has no documented per-skill form, so we do not print one.
Python background job patterns including task queues, workers, and event-driven architecture. Use when implementing async task processing, job queues, long-running operations, or decoupling work from request/response cycles.
The verbatim description from this skill’s front matter — the string an agent matches on to decide whether to load it.
main, last pushed 5 August 2026.SKILL.md, not by matching a directory convention. 49 distinct layouts observed: plugins/accessibility-compliance/skills/*/SKILL.md, plugins/agent-teams/skills/*/SKILL.md, plugins/api-scaffolding/skills/*/SKILL.md, plugins/backend-development/skills/*/SKILL.md, plugins/before-you-build/skills/*/SKILL.md, plugins/block-no-verify/skills/*/SKILL.md, plugins/blockchain-web3/skills/*/SKILL.md, plugins/brand-landingpage/skills/*/SKILL.md, plugins/business-analytics/skills/*/SKILL.md, plugins/cicd-automation/skills/*/SKILL.md, plugins/cloud-infrastructure/skills/*/SKILL.md, plugins/conductor/skills/*/SKILL.md, plugins/data-engineering/skills/*/SKILL.md, plugins/database-design/skills/*/SKILL.md, plugins/developer-essentials/skills/*/SKILL.md, plugins/dgx-spark-ops/skills/*/SKILL.md, plugins/documentation-generation/skills/*/SKILL.md.plugins/documentation-standards/skills/*/SKILL.mdplugins/dotnet-contribution/skills/*/SKILL.mdplugins/file-conversion/skills/*/SKILL.mdplugins/framework-migration/skills/*/SKILL.mdplugins/frontend-mobile-development/skills/*/SKILL.mdplugins/game-development/skills/*/SKILL.mdplugins/hermes-tweet/skills/*/SKILL.mdplugins/hr-legal-compliance/skills/*/SKILL.mdplugins/incident-response/skills/*/SKILL.mdplugins/javascript-typescript/skills/*/SKILL.mdplugins/kubernetes-operations/skills/*/SKILL.mdplugins/llm-application-dev/skills/*/SKILL.mdplugins/llm-finetuning/skills/*/SKILL.mdplugins/machine-learning-ops/skills/*/SKILL.mdplugins/observability-monitoring/skills/*/SKILL.mdplugins/payment-processing/skills/*/SKILL.mdplugins/plugin-eval/skills/*/SKILL.mdplugins/pptx-deck-creation/skills/*/SKILL.mdplugins/protect-mcp/skills/*/SKILL.mdplugins/python-development/skills/*/SKILL.mdplugins/quantitative-trading/skills/*/SKILL.mdplugins/reverse-engineering/skills/*/SKILL.mdplugins/review-agent-governance/skills/*/SKILL.mdplugins/security-scanning/skills/*/SKILL.mdplugins/shell-scripting/skills/*/SKILL.mdplugins/ship-mate/skills/*/SKILL.mdplugins/signed-audit-trails/skills/*/SKILL.mdplugins/skill-forge-essentials/skills/*/SKILL.mdplugins/social-publishing/skills/*/SKILL.mdplugins/startup-business-analyst/skills/*/SKILL.mdplugins/systems-programming/skills/*/SKILL.mdplugins/ui-design/skills/*/SKILL.mdh1 and no skipped levels:.claude-plugin/marketplace.json by Seth Hobson, declaring 95 plugins. It is read for editorial metadata only — never as the skill index, which is always the repository tree./wshobson/agents.md, and each chapter at its own .md URL.1 file · 3 KB
Everything this skill ships beside its prose. All of it is set here, as a subchapter of chapter 129.
Documentation the agent loads on demand, rather than up front.