Process background jobs reliably with retries, scheduling, and concurrency control. Supports Redis-backed queues, Postgres-based queues, and in-memory for development.
Redis-backed job queue with scheduling, retries, and dashboard
REDIS_URLPostgreSQL-based job queue with no additional infrastructure
DATABASE_URLSimple in-process queue for development and testing
Enqueue a background job
Add a job to the queue for async processing
import { queue } from '@/lib/queue'
// Enqueue a job
await queue.add('send-welcome-email', {
userId: user.id,
email: user.email,
})
// Process jobs
queue.process('send-welcome-email', async (job) => {
await sendWelcomeEmail(job.data.email)
})Add queue to your Primstack project with a single command:
prim queue init