Reliable Django Signals
summary
Claims Django signals are unreliable for mission‑critical workflows and replaces immediate delivery with a queued approach built on Django 6 tasks and a database-backed task queue. The implementation adds send_reliable which enqueues each receiver inside the sender transaction so commits guarantee at least once delivery, runs receivers in separate workers and gains retries. Demo shows a worker picks up tasks and syncs orders. Limitations: receiver args must be serializable, partial compatibility with existing signals, and a background worker is required.
AI-written summary · about
chapters (22)
- 0:00Introduction and setup
- 1:27Speaker introduction
- 2:14What is a workflow?
- 2:56Building a checkout workflow
- 8:21The circular dependency problem
- 10:51Spaghetti dependencies explained
- 12:16Polling for changes approach
- 14:25Introducing Django signals
- 17:18Challenges with signal receivers
- 20:52Moving signals out of transactions
- 21:14Fault tolerance requirements
- 23:00Desired signal behavior
- 24:53Database queue solution
- 27:03Setting up the infrastructure
- 27:48Referencing callable functions
- 29:11Implementing reliable signals
- 30:17Testing the solution
- 31:22Achievements and benefits
- 31:42Limitations and restrictions
- 32:44Future improvements
- 33:30Resources and outbox pattern
- 33:50Q&A and closing
