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
pip
pip install dramatiqMethods
No methods match this filter.
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.
@dramatiq.actor→ signature from https://dramatiq.io/reference.html; official text: “dramatiq.actor(fn:Callable[[P], R]) → Actor[P,R]”actor.send→ signature from https://dramatiq.io/reference.html; official text: “send(*args: ~typing.~P, **kwargs: ~typing.~P) →Message[R]”dramatiq.Worker→ signature from https://raw.githubusercontent.com/Bogdanp/dramatiq/master/dramatiq/worker.py; official text: “def init( self, broker: Broker, *, queues: Optional[set[str]] = None, worker_timeout: int = WORKER_TIMEOUT, worker_threads: int = 8,”
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.
Report a problem with this API docOpens a pre-filled issue on GitHub.