driftwood v2.3 DocsAPIChangelog

Introduction

Driftwood is a small, dependency-free task queue for Python. It does one thing: run background jobs reliably, without pulling in a broker you have to operate.

Install

python -m pip install driftwood

A first task

Decorate a function with @task, enqueue it, and let a worker pick it up.

from driftwood import task, Queue

@task(retries=3)
def send_email(to, subject):
    ...

q = Queue("redis://localhost")
q.enqueue(send_email, "ada@example.com", "Welcome")
Driftwood stores state in whatever backend you point it at — SQLite for a single box, Redis or Postgres once you outgrow it. No daemon of its own.

Run a worker

driftwood worker --queue default --concurrency 4

That's the whole model. See Workers for concurrency, graceful shutdown and signal handling.