Skill files6 files

references/

scripts/

templates/

SKILL.md104 lines
1
---
2
name: batch-processing-jobs
3
description: >
4
Implement robust batch processing systems with job queues, schedulers,
5
background tasks, and distributed workers. Use when processing large datasets,
6
scheduled tasks, async operations, or resource-intensive computations.
7
---
8
9
# Batch Processing Jobs
10
11
## Table of Contents
12
13
- [Overview](#overview)
14
- [When to Use](#when-to-use)
15
- [Quick Start](#quick-start)
16
- [Reference Guides](#reference-guides)
17
- [Best Practices](#best-practices)
18
19
## Overview
20
21
Implement scalable batch processing systems for handling large-scale data processing, scheduled tasks, and async operations efficiently.
22
23
## When to Use
24
25
- Processing large datasets
26
- Scheduled report generation
27
- Email/notification campaigns
28
- Data imports and exports
29
- Image/video processing
30
- ETL pipelines
31
- Cleanup and maintenance tasks
32
- Long-running computations
33
- Bulk data updates
34
35
## Quick Start
36
37
Minimal working example:
38
39
```typescript
40
import Queue from "bull";
41
import { v4 as uuidv4 } from "uuid";
42
43
interface JobData {
44
id: string;
45
type: string;
46
payload: any;
47
userId?: string;
48
metadata?: Record<string, any>;
49
}
50
51
interface JobResult {
52
success: boolean;
53
data?: any;
54
error?: string;
55
processedAt: number;
56
duration: number;
57
}
58
59
class BatchProcessor {
60
private queue: Queue.Queue<JobData>;
61
private resultQueue: Queue.Queue<JobResult>;
62
63
constructor(redisUrl: string) {
64
// Main processing queue
65
// ... (see reference guides for full implementation)
66
```
67
68
## Reference Guides
69
70
Detailed implementations in the `references/` directory:
71
72
| Guide | Contents |
73
|---|---|
74
| [Bull Queue (Node.js)](references/bull-queue-nodejs.md) | Bull Queue (Node.js) |
75
| [Celery-Style Worker (Python)](references/celery-style-worker-python.md) | Celery-Style Worker (Python) |
76
| [Cron Job Scheduler](references/cron-job-scheduler.md) | Cron Job Scheduler |
77
78
## Best Practices
79
80
### ✅ DO
81
82
- Implement idempotency for all jobs
83
- Use job queues for distributed processing
84
- Monitor job success/failure rates
85
- Implement retry logic with exponential backoff
86
- Set appropriate timeouts
87
- Log job execution details
88
- Use dead letter queues for failed jobs
89
- Implement job priority levels
90
- Batch similar operations together
91
- Use connection pooling
92
- Implement graceful shutdown
93
- Monitor queue depth and processing time
94
95
### ❌ DON'T
96
97
- Process jobs synchronously in request handlers
98
- Ignore failed jobs
99
- Set unlimited retries
100
- Skip monitoring and alerting
101
- Process jobs without timeouts
102
- Store large payloads in queue
103
- Forget to clean up completed jobs
104

© AJ Geddes · MIT · source · posted by @OpenSourceBuffGuy on promptparty.com

@OpenSourceBuffGuy

I find openly licensed prompts and post them here.

0 followers · 14,621 prompts

More by @OpenSourceBuffGuy

See all
Sea turtle carrying floating film studio island prompt image

Sea turtle carrying floating film studio island

Draws a giant sea turtle carrying a floating island film studio through a starry sky, where fairies polish rough film strips into golden film.

image-prompt, nano-banana, 3d-render, cartoon, fantasy-world, creatures, animals, whimsical, dreamy, cinematic, dramatic-lighting, vibrant-colors, bokeh, miniature, widescreen, night-scene, illustration, concept-art, surreal, storytelling, clay-3d

Desert buggy escapes drones past industrial outpost prompt image

Desert buggy escapes drones past industrial outpost

Builds a 15-second desert chase video where a racer in an armored buggy escapes drones past an industrial outpost, using five reference images with set jobs.

video-prompt, hailuo, action, multi-shot, timed-beats, camera-movement, reference-image, character-consistency, negative-prompt, cinematic, sci-fi, cars, landscape, aerial-view, tracking-shot, photorealistic, sound-effects, structured-output, long-form, widescreen

1 view
Cozy Pixel Art Farm Island Village prompt image

Cozy Pixel Art Farm Island Village

Draws a cozy 16-bit pixel-art farming village across six small islands joined by bridges, with exact counts for buildings, animals and crops.

image-prompt, gpt-image, pixel-art, isometric, game-assets, concept-art, maps, worldbuilding, cozy, vibrant-colors, ocean, landscape, wide-shot, widescreen, game-development, video-games, structured-output, whimsical, summer, high-angle, aerial-view, animals, negative-prompt, cityscape

1 view

Reviews

Loading reviews…

Discussion

Loading comments…