patricio0312rev avatar

Queue Job Processor

This handles background job processing with BullMQ and Redis, giving you queues, workers, retry logic, and progress tracking. The implementation covers common patterns like email sending, image processing, webhook delivery, and report generation, with type-safe job definitions and exponential backoff for failures. It includes rate limiting, concurrency controls, and proper connection management for Redis. The worker examples show real integration points like S3 uploads and email rendering. If you need async tasks that survive server restarts or want to offload slow operations from your request cycle, this gives you the complete setup. The code is production-ready with monitoring hooks and configurable retention policies for completed jobs.

skills.sh installs
295
GitHub stars
63
last updated
Aug 21, 2026

Install

$ npx -y skills add patricio0312rev/skills --skill queue-job-processor --agent claude-code

Installs into .claude/skills of the current project.

Files

Queue Job Processor

Build robust background job processing with BullMQ and Redis.

Core Workflow

  1. Setup Redis: Configure connection
  2. Create queues: Define job queues
  3. Implement workers: Process jobs
  4. Add job types: Type-safe job definitions
  5. Configure retries: Handle failures
  6. Add monitoring: Dashboard and alerts

Installation

npm install bullmq ioredis
npm install -D @types/ioredis

Redis Connection

// lib/redis.ts
import IORedis from 'ioredis';

export const redis = new IORedis(process.env.REDIS_URL!, {
  maxRetriesPerRequest: null, // Required for BullMQ
  enableReadyCheck: false,
});

export const redisSubscriber = new IORedis(process.env.REDIS_URL!, {
  maxRetriesPerRequest: null,
  enableReadyCheck: false,
});

Queue Setup

Define Job Types

// jobs/types.ts
export interface EmailJobData {
  to: string;
  subject: string;
  template: string;
  variables: Record<string, string>;
}

export interface ImageProcessingJobData {
  imageId: string;
  userId: string;
  operations: Array<{
    type: 'resize' | 'crop' | 'watermark';
    params: Record<string, any>;
  }>;
}

Sponsors

Details

Repository
github.com/patricio0312rev/skills
Categories
Backend & APIs, DevOps & CI/CD, Databases
First seen
Jun 3, 2026

More from patricio0312rev/skills

All 138
1patricio0312rev avatarapi-security-hardenerpatricio0312rev/skillsHardens API security with rate limiting, input validation, authentication, and protection against common attacks. Use when users request "API security", "secure284skills.sh installs
2pedronauck avatarbetter-auth-best-practicespedronauck/skillsSkill for integrating Better Auth - the comprehensive TypeScript authentication framework.281skills.sh installs
3whoamihappyhacking avatarlazycat-auth-integrationwhoamihappyhacking/lazycat-skills用于处理懒猫微服(Lazycat MicroServer)应用接入官方认证体系(OIDC单点登录)、HTTP Header用户身份识别、API Auth Token 以及配置独立鉴权(public_path)的专业指南。231skills.sh installs
4davila7 avatarena-databasedavila7/claude-code-templatesAccess European Nucleotide Archive via API/FTP. Retrieve DNA/RNA sequences, raw reads (FASTQ), genome assemblies by accession, for genomics and bioinformatics p218skills.sh installs
5iii-hq avatariii-reactive-backendiii-hq/iiiBuilds reactive real-time backends on the iii engine. Use when building event-driven apps where state changes automatically trigger side effects, clients receiv192skills.sh installs
6iii-hq avatariii-http-middlewareiii-hq/iiiRegisters engine-level middleware functions that run before HTTP handlers. Use when adding authentication, request logging, rate limiting, or any pre-handler lo178skills.sh installs