Scheduler 03: Heap and Timing Wheel

Follows Scheduler 02: Durable Job Store, and hands off to Scheduler 04: Leader Election.
Before you start. This series builds a small job scheduler: a program you hand a piece of work and a time, and it runs that work when the time comes, again and again if you ask it to. Our scheduler already survives a restart: every job’s next run time lives in a table on disk, not only in memory. Right now, finding out which jobs are due means walking that whole table, one job at a time, every single second. This lesson replaces that walk.