01 · Build a queue
Validate work requests, persist them in SQLite, and distinguish exact replays from changed payloads.
Continue from Part II
Turn a local reporting script into durable work. Claim jobs safely, recover from worker failures, and rehearse a release with evidence you can check.

12 chapters
12 chapters
Represent job lifecycles with explicit states and invariants. Distinguish a valid state value from an allowed transition.
Pages 5–77 · 8 casesModel time at the decision boundary. Work with deadlines, inclusive schedule checks, expired leases and anchored periodic work.
Pages 78–150 · 8 casesValidate and normalize input before it becomes durable. Use stable identity, size limits and exact comparisons.
Pages 151–223 · 8 casesPut a limit on what enters a worker. Track admission capacity, batch size, workload cost and scheduling order.
Pages 224–296 · 8 casesMake ownership visible. Attach a generation to each assignment and use conditional writes to refuse stale results.
Pages 337–409 · 8 casesRetry only eligible failures and keep a budget. Separate permanent rejection, uncertain side effects and transient errors.
Pages 410–482 · 8 casesChoose a concurrency strategy with bounded work and explicit completion order. Keep cancellation and waiting distinct.
Pages 483–555 · 8 casesRecover a job by examining durable facts. Compare receipts and verify candidate snapshots before using them.
Pages 556–628 · 8 casesMeasure transitions and outcomes with a known population. Keep sensitive data out of diagnostic event fields.
Pages 669–741 · 8 casesPlan upgrades for existing records and refuse unsupported versions. Treat the shipped artifact as something that needs verification.
Pages 742–814 · 8 casesKeep operator actions within their allowed scope. Validate names and values before routing a command, opening a file or comparing a credential.
Pages 815–887 · 8 casesRehearse recovery from the same evidence an operator has. Confirm release gates and record what remains uncertain.
Pages 888–960 · 8 casesThree connected projects
Validate work requests, persist them in SQLite, and distinguish exact replays from changed payloads.
Claim work with a lease, fence off stale results, and recover with a bounded retry policy.
Read the audit trail, check a database snapshot, and run a repeatable release rehearsal.
Look inside
Try a state-machine case in the free 16-page excerpt. Preview the source pages from each project.

The PDF and ZIP include 96 runnable cases with assertions and recorded output, a project suite with tests, and a curriculum index. Use Python 3.12 or newer.
Open the Gumroad listing · $20USD base price. Applicable tax is calculated at checkout.