‹ 首页

batch-processing-jobs

@aj-geddes · 收录于 5 天前 · 上游提交 4 个月前

Implement robust batch processing systems with job queues, schedulers, background tasks, and distributed workers. Use when processing large datasets, scheduled tasks, async operations, or resource-intensive computations.

适合你,如果需要处理大量数据或执行定时后台任务

/ 通过 npx 安装 校验哈希
npx oh-my-skill add aj-geddes/useful-ai-prompts/batch-processing-jobs
/ 通过 bash 安装
curl -fsSL https://oh-my-skill.com/install.sh | bash -s -- aj-geddes/useful-ai-prompts/batch-processing-jobs
/ 已经装过?验证本机副本,不用重装
npx oh-my-skill verify aj-geddes/useful-ai-prompts/batch-processing-jobs
安装目标可用 --agent / --scope 或 --to 明确指定;省略时只会在唯一已存在的 agent 目录上自动选择,零命中或多命中会停止并提示。content_hash 缺失或不一致均拒装。
300GitHub stars
~472最小装载
~3.6K含声明引用
~3.8K文本包总量
索引托管

怎么用

商店整理自技能原文 · 版本 3f5182c · 表述以原文为准
它做什么

安装后,Claude 能够帮助你设计和实现批处理系统,包括作业队列、调度器、后台任务和分布式工作者。它会提供代码示例和最佳实践建议。

什么时候触发

当你需要处理大型数据集、定时任务、异步操作或资源密集型计算时触发,例如批量数据更新或报告生成。

装好后可以这样说
Claude 会提供使用 Bull Queue 的示例代码。
Claude 会建议指数退避和死信队列。
Claude 会展示 Cron 调度器的用法。
技能原文 SKILL.md作者撰写 · MIT · 3f5182c

Batch Processing Jobs

Table of Contents
  • [Overview](#overview)
  • [When to Use](#when-to-use)
  • [Quick Start](#quick-start)
  • [Reference Guides](#reference-guides)
  • [Best Practices](#best-practices)
Overview

Implement scalable batch processing systems for handling large-scale data processing, scheduled tasks, and async operations efficiently.

When to Use
  • Processing large datasets
  • Scheduled report generation
  • Email/notification campaigns
  • Data imports and exports
  • Image/video processing
  • ETL pipelines
  • Cleanup and maintenance tasks
  • Long-running computations
  • Bulk data updates
Quick Start

Minimal working example:

import Queue from "bull";
import { v4 as uuidv4 } from "uuid";

interface JobData {
  id: string;
  type: string;
  payload: any;
  userId?: string;
  metadata?: Record<string, any>;
}

interface JobResult {
  success: boolean;
  data?: any;
  error?: string;
  processedAt: number;
  duration: number;
}

class BatchProcessor {
  private queue: Queue.Queue<JobData>;
  private resultQueue: Queue.Queue<JobResult>;

  constructor(redisUrl: string) {
    // Main processing queue
// ... (see reference guides for full implementation)
Reference Guides

Detailed implementations in the references/ directory:

| Guide | Contents | |---|---| | [Bull Queue (Node.js)](references/bull-queue-nodejs.md) | Bull Queue (Node.js) | | [Celery-Style Worker (Python)](references/celery-style-worker-python.md) | Celery-Style Worker (Python) | | [Cron Job Scheduler](references/cron-job-scheduler.md) | Cron Job Scheduler |

Best Practices
✅ DO
  • Implement idempotency for all jobs
  • Use job queues for distributed processing
  • Monitor job success/failure rates
  • Implement retry logic with exponential backoff
  • Set appropriate timeouts
  • Log job execution details
  • Use dead letter queues for failed jobs
  • Implement job priority levels
  • Batch similar operations together
  • Use connection pooling
  • Implement graceful shutdown
  • Monitor queue depth and processing time
❌ DON'T
  • Process jobs synchronously in request handlers
  • Ignore failed jobs
  • Set unlimited retries
  • Skip monitoring and alerting
  • Process jobs without timeouts
  • Store large payloads in queue
  • Forget to clean up completed jobs
按 MIT 许可原样转载,未经改动 · 在 GitHub 查看 →

评论

登录即可评论;带「已验证安装」的,是发布者名下有本店的安装或持有记录。