MiniCTRM - Build Tutorial 622: Running jobs in parallel: the end of day in ten minutes, not twenty
→ to begin · N for the speaker notes
On a phone: Next or a swipe left to begin, Notes for the words.
What you'll learn
A job set as a graph of steps with dependencies, a worker pool sized to the machine with a scheduler that starts every ready step, two ten-minute reports done in ten with a wall-clock test to prove it, a log per step, one retry-safe door for every background write with the SQLite-against-PostgreSQL rule written down, every step safe to run twice with Retry from this step and Cancel, and the End of Day set rewired.
A job set as a graph – Each step names what it waits for; the steps that wait for the same thing can run together.
A worker pool, and the proof – Cores, threads and a scheduler that starts every ready step; then two ten-second reports done in ten, on the clock.
The database's rules – Many readers and one writer on SQLite, one retry-safe door for every background write, and when PostgreSQL is the answer.
Safe to run twice – Idempotent steps, Retry from this step, and Cancel between steps.
The end of day rewired, then ship – The End of Day set's dependencies declared, the saving on the History screen, a rule in CLAUDE.md, and /ship.
How MiniCTRM did it – Groups in order and no graph, on purpose, and the two pieces your parallel runner grew from.
Copyright 2026-2027 Brian Shydlo. MiniCTRM is source-available under the PolyForm Strict License 1.0.0 (https://polyformproject.org/licenses/strict/1.0.0): free for learning and other noncommercial use; no changes and no redistribution; commercial use needs permission.
Welcome
The night is twice as long as it needs to be
1 / 17A job set as a graph
Parallel, and what a step waits for
2 / 17A job set as a graph
An end of day, step by step
3 / 17A job set as a graph
Each step names what it waits for
4 / 17A worker pool, and the proof
Workers, cores and a scheduler
5 / 17A worker pool, and the proof
The worker pool
6 / 17A worker pool, and the proof
Two reports in ten, on the clock
7 / 17The database's rules
Many readers, one writer
8 / 17The database's rules
SQLite against PostgreSQL for a parallel night
9 / 17The database's rules
One retry-safe door for every background write
10 / 17Safe to run twice
Safe to run twice
11 / 17Safe to run twice
Idempotent steps, Retry from this step, Cancel
12 / 17The end of day rewired, then ship
The End of Day set, rewired
13 / 17The end of day rewired, then ship
Ship it
14 / 17How MiniCTRM did it
Job Automation: groups in order, no graph
15 / 17How MiniCTRM did it
Run Scripts: the worker, the log and the door
16 / 17What you have now
What you have now
17 / 17
You have finished lesson 622, Running jobs in parallel: the end of day in ten minutes, not twenty.