Skip to main content

Pilotwave

Enqueue email in Django, deliver it from a tiny Rust daemon. Postgres is the only queue. No Redis, no RabbitMQ, no second Django in RAM.

Pilotwave is a two-part email outbox for Django:

  1. Producer (Python): your view calls mail_notification.enqueue(...) — a single Postgres INSERT via django.tasks + django-tasks-db. The request returns immediately, no SMTP in the request cycle.
  2. Worker (Rust): the static pilotwave-worker binary polls Postgres with FOR UPDATE SKIP LOCKED, sends via SMTP, marks the row SUCCESSFUL/FAILED, and upserts a heartbeat row.
Django view --enqueue--> Postgres --claim--> pilotwave-worker --SMTP--> mail server
                                    |                |
                             SUCCESSFUL/FAILED    heartbeat (last_seen + counters)
                                    |                |
                                    v                v
                                 Postgres <-- pilotwave_heartbeat

Why this exists

Small VPS / shared hosting where you can afford Django + Postgres + Nginx and little else:

  • A resident Python worker (db_worker, Celery worker) costs a full Django RSS just to poll — typically 80–180 MB.
  • Redis needs its own daemon and memory (~100 MB growth triggered the OOM-killer on our shared host), plus backup and monitoring.
  • Pilotwave replaces both with one ~5 MB static binary that speaks Postgres and SMTP directly.

Measured in this repo: the release worker holds ≈10x less RSS than a minimal Python baseline doing the same 100-mail run — full table, method and raw numbers in benchmark/ (see results).

That run reproduces only against the benchmark's fake SMTP on :1026 (with AUTH, not Mailcrab :1025), needs Docker plus a release build, and there idle RSS equals max. One machine, one run: re-run just benchmark before quoting. We know the benchmark's limits (see caveats); feedback is welcome.

How does it look like?

Install the wheel, configure TASKS, enqueue from your view, drain with run and check with status — full walkthrough in 01-QUICKSTART.md.

That example is deliberately simple; production code needs more careful patterns (see Transactions in Django's tasks docs). In particular, if the view runs in an atomic transaction, defer the enqueue with transaction.on_commit so the worker never claims the row before it is committed.

Interested?

Limitations (alpha)

Status: alpha. Email-only, API unstable, hardening in progress.

  • At-least-once delivery. A crash after send can duplicate a mail. Producers must be idempotent by reference. No dedupe table in place yet.
  • Email-only, Postgres-only. Only pilotwave-worker drains the pilotwave.email queue; no Python fallback ships.
  • Polling, not push. Expect seconds of delay; size limits are documented in 02-CONFIGURATION.md, SSOT contracts/CONTRACT.md.
  • One benchmark. Numbers above come from a single host/run — re-run just benchmark before quoting.

Where to go next

License

MIT — see LICENSE.

Metadata

Release files for pilotwave 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pilotwave 0.4.0
File Size Uploaded Provenance Actions
pilotwave-0.4.0.tar.gz 89.3 kB With provenance Details for pilotwave-0.4.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pilotwave 0.4.0
File Interpreter ABI Platform Actions
pilotwave-0.4.0-py3-none-manylinux1_x86_64.manylinux_2_5_x86_64.whl Python 3 none Linux glibc 2.5+ x86-64 Details for pilotwave-0.4.0-py3-none-manylinux1_x86_64.manylinux_2_5_x86_64.whl

Total release size: 1.9 MB

Release files / pilotwave-0.4.0.tar.gz

Download URL pilotwave-0.4.0.tar.gz
Size 89.3 kB
Tags Source
SHA-256 checksum
How to use checksums
ccd33d941d601f277fd8504c9b7399ee056440e159ad951cb1c224ad87628a80
BLAKE2b-256 checksum
How to use checksums
6fb09eedd88312ae685d69bd9e1da551ce4d0f29da3b922eecef4b410652a458
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 27, 2026.

Transparency log

Release files / pilotwave-0.4.0-py3-none-manylinux1_x86_64.manylinux_2_5_x86_64.whl

Download URL pilotwave-0.4.0-py3-none-manylinux1_x86_64.manylinux_2_5_x86_64.whl
Size 1.8 MB
Tags Linux glibc 2.5+ x86-64 Python 3
SHA-256 checksum
How to use checksums
aa5bc032a706bea545c5aff120d5de90a8acec243455251fb75d29a24af0d6e3
BLAKE2b-256 checksum
How to use checksums
d0876bf2a06b59009f929fd3d06288a6543654b779dc59b602dbf28e1daf2c6a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 27, 2026.

Transparency log

Security for pilotwave 0.4.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for pilotwave-0.4.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 27, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page