Skip to content

Task queue

Category: Communication · Status: stub · Lessons: chapter 05, Message passing (planned)

One line: A queue of jobs that workers take and run — within one program, or across processes and machines with a broker in between.

Also called: job queue, work queue, Celery.

How it connects

flowchart LR
  n_producer_consumer["Producer-consumer"]
  n_task_queue["Task queue"]
  n_task_queue -->|uses| n_producer_consumer
  classDef center stroke-width:3px
  class n_task_queue center
  classDef outside stroke-dasharray: 4 3
  class n_producer_consumer outside

In each language

Java BlockingQueue, which an ExecutorService uses for its waiting tasks
Python queue.Queue between threads, asyncio.Queue between tasks
Elsewhere Celery ↗ runs Python tasks on workers fed through a message broker

Where to read more