FREE COURSE / REAL PRACTICE
Queues, retries & reliable background work
Build deterministic Python models of bounded work admission, delivery ownership, retry budgets and idempotent effects, then integrate a restartable job-state simulation.
What you’ll work toward
Explain and test bounded admission, FIFO/priority order, producer-consumer ownership, acknowledgement/redelivery, capped retry budgets, idempotency, quarantine and ordered restart-state policies. The exercises are in memory and do not establish production durability or exactly-once delivery.
Read an explanation, inspect the diagrams and work through the available checks, debugging exercises and builds. Feedback and prerequisite links guide the next step.
Before you start
This course builds on these skills:
Individual lessons can add prerequisites. The course map shows your actual readiness.
A look inside the first lesson
Bounded FIFO & priority queues
from collections import deque
import heapq
ready = deque(["first", "second"])
print(ready.popleft())
heap = []
for sequence, (priority, job) in enumerate([(4, "slow"), (1, "urgent"), (1, "also urgent")]):
heapq.heappush(heap, (priority, sequence, job))
print([heapq.heappop(heap)[2] for _ in range(3)])Your course outline
Follow the lessons in curriculum order. Open a unit to preview the ideas you’ll work with.
Bounded work and delivery ownership
- LESSON 01.01
Bounded FIFO & priority queues
Separate admission, service order and stable priority ties in a bounded in-memory buffer.
Open lesson - LESSON 01.02
Producer-consumer state & backpressure
Model admission, worker ownership, completion and graceful draining without threads or timing assumptions.
Open lesson - LESSON 01.03
Acknowledgements, leases & redelivery
Keep delivery tokens separate from job identity and reject stale acknowledgements at exact lease boundaries.
Open lesson
Retry safety and poison handling
- LESSON 02.01
Retry budgets, backoff & fake clocks
Schedule bounded retries with capped exponential delays and an exclusive start deadline, without sleeping.
Open lesson - LESSON 02.02
Idempotency keys & effect deduplication
Apply an account effect once per stable message key and reject conflicting key reuse without partial state.
Open lesson - LESSON 02.03
Poison messages & controlled replay
Separate transient failures from permanent poison work, retain diagnostics and make replay an explicit decision.
Open lesson