API Reference

Dramatiq

A background task processing library for Python with Redis and RabbitMQ brokers and automatic retries.

Official Documentation ↗
CompatibilityThis documentation covers version v1.17. Check the official docs for the latest API surface.

Installation

pippip install dramatiq

Methods

Dramatiq defines actors as decorated functions and runs them via a broker-backed worker.

Key Features

  • Actor-based task definitions
  • Automatic retries with backoff
  • Multiple brokers including Redis and RabbitMQ

Usage Notes

Pin a version and check the official docs for the API surface you depend on before upgrading.

API reference evidence

Fetched from official sources on 2026-11-08T19:15:00+08:00 via WebFetch https://dramatiq.io/reference.html;PowerShell Invoke-WebRequest https://raw.githubusercontent.com/Bogdanp/dramatiq/master/dramatiq/worker.py.

FAQ

How do retries and backoff work?
Failed actors are retried up to max_retries with exponential backoff by default, which suits transient downstream errors.
How do I set the broker?
Instantiate a broker such as RedisBroker and pass it to dramatiq.set_broker before importing actor modules.
Are tasks idempotent?
Not automatically. Retries mean actors can run more than once, so make side effects idempotent or track deduplication keys.