_CORE
AI & Agentic Systems Core Information Systems Cloud & Platform Engineering Data Platform & Integration Security & Compliance QA, Testing & Observability IoT, Automation & Robotics Mobile & Digital Banking & Finance Insurance Public Administration Defense & Security Healthcare Energy & Utilities Telco & Media Manufacturing Logistics & E-commerce Retail & Loyalty
References Technologies Blog Know-how Tools
About Collaboration Careers
CS EN
Let's talk

Async Job Queues

05. 12. 2025 1 min read intermediate

Posílání emailů, generování PDF, zpracování obrázků — to nepatří do HTTP requestu. Job queue to vyřeší.

Celery (Python)

tasks.py

from celery import Celery app = Celery(‘tasks’, broker=’redis://localhost:6379’) @app.task def send_email(to, subject, body):

Pomalá operace — běží na workeru, ne v requestu

smtp.send(to, subject, body)

Volání

send_email.delay(“[email protected]”, “Welcome”, “Hello!”) send_email.apply_async(args=[…], countdown=60) # Za 60s

BullMQ (Node.js)

import { Queue, Worker } from ‘bullmq’; const queue = new Queue(‘emails’, { connection: redis }); await queue.add(‘welcome’, { to: ‘[email protected]’ }); const worker = new Worker(‘emails’, async (job) => { await sendEmail(job.data.to, ‘Welcome’); }, { connection: redis });

When to Use queue

  • Operace > 500ms
  • Email, SMS, push notifications
  • Generování reportů, PDF
  • Image/video processing
  • Webhooky, integrace

Key Takeaway

Queue pro vše, co trvá > 500ms. Celery pro Python, BullMQ pro Node.js. Redis jako broker.

queuecelerybullmqbackground jobs
Share:

CORE SYSTEMS tým

Stavíme core systémy a AI agenty, které drží provoz. 15 let zkušeností s enterprise IT.