background-job-processing by aj-geddes/useful-ai-prompts
npx skills add https://github.com/aj-geddes/useful-ai-prompts --skill background-job-processing构建健壮的后台作业处理系统,包含分布式任务队列、工作池、作业调度、错误处理、重试策略和监控,以实现高效的异步任务执行。
最小工作示例:
# celery_app.py
from celery import Celery
from kombu import Exchange, Queue
import os
app = Celery('myapp')
# Configuration
app.conf.update(
broker_url=os.getenv('REDIS_URL', 'redis://localhost:6379/0'),
result_backend=os.getenv('REDIS_URL', 'redis://localhost:6379/0'),
task_serializer='json',
accept_content=['json'],
result_serializer='json',
timezone='UTC',
enable_utc=True,
task_track_started=True,
task_time_limit=30 * 60, # 30 minutes
task_soft_time_limit=25 * 60, # 25 minutes
broker_connection_retry_on_startup=True,
)
# Queue configuration
default_exchange = Exchange('tasks', type='direct')
app.conf.task_queues = (
// ... (see reference guides for full implementation)
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
references/ 目录下的详细实现:
| 指南 | 内容 |
|---|---|
| Python with Celery and Redis | Python 搭配 Celery 和 Redis |
| Node.js with Bull Queue | Node.js 搭配 Bull Queue |
| Ruby with Sidekiq | Ruby 搭配 Sidekiq |
| Job Retry and Error Handling | 作业重试与错误处理 |
| Monitoring and Observability | 监控与可观测性 |
每周安装数
134
仓库
GitHub 星标数
116
首次出现
2026年1月21日
安全审计
安装于
opencode111
gemini-cli109
codex107
cursor104
claude-code104
github-copilot91
Build robust background job processing systems with distributed task queues, worker pools, job scheduling, error handling, retry policies, and monitoring for efficient asynchronous task execution.
Minimal working example:
# celery_app.py
from celery import Celery
from kombu import Exchange, Queue
import os
app = Celery('myapp')
# Configuration
app.conf.update(
broker_url=os.getenv('REDIS_URL', 'redis://localhost:6379/0'),
result_backend=os.getenv('REDIS_URL', 'redis://localhost:6379/0'),
task_serializer='json',
accept_content=['json'],
result_serializer='json',
timezone='UTC',
enable_utc=True,
task_track_started=True,
task_time_limit=30 * 60, # 30 minutes
task_soft_time_limit=25 * 60, # 25 minutes
broker_connection_retry_on_startup=True,
)
# Queue configuration
default_exchange = Exchange('tasks', type='direct')
app.conf.task_queues = (
// ... (see reference guides for full implementation)
Detailed implementations in the references/ directory:
| Guide | Contents |
|---|---|
| Python with Celery and Redis | Python with Celery and Redis |
| Node.js with Bull Queue | Node.js with Bull Queue |
| Ruby with Sidekiq | Ruby with Sidekiq |
| Job Retry and Error Handling | Job Retry and Error Handling |
| Monitoring and Observability | Monitoring and Observability |
Weekly Installs
134
Repository
GitHub Stars
116
First Seen
Jan 21, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
opencode111
gemini-cli109
codex107
cursor104
claude-code104
github-copilot91
agent-browser 浏览器自动化工具 - Vercel Labs 命令行网页操作与测试
152,900 周安装