Fork me on GitHub

Task queues

Task queues handle background work that need to be processed outside the usual HTTP request-response cycle. These tasks are handled asynchronously because HTTP requests must be responded back to by the server as fast as possible otherwise the user experience in the web browser will suffer. The most common types of jobs for task queues include

  • calculating computationally expensive data analytics

  • scheduling periodic jobs such as batch processes

  • spreading out large numbers of independent database inserts over time instead of all at once

  • aggregating collected data values on a fixed interval, such as every 15 minutes

Task queue projects

  • The Celery distributed task queue is the most commonly used Python library for handling asynchronous tasks and scheduling.

  • The RQ (Redis Queue) is a simple Python library for queueing jobs and processing them in the background with workers. RQ is backed by Redis and it is designed to have a low barrier to entry. The intro post contains information on design decisions and how to use RQ.

  • Taskmaster is a lightweight simple distributed queue for handling large volumes of one-off tasks.

Task queue resources


Next read the api integration section.