FIG_002 [ SCHEDULER ]
FIG_002 // Interactive Cutaway durability

DurabilityScheduler

Multiplexes every primitive's due times onto a Durable Object's single physical alarm with bounded concurrency.

FIG_002 [ DURABILITY_SCHEDULER ] MIN(DUE) // 1 ALARM
1 TX Reconcile MIN() 2 Early Timer / Bell 3 FIFO Permits / Handoff
1 / 5
ARMED (+25s): Click any capability rail on the left to toggle due work, test sub-15s Balance Wheel early timers, or evict the DO to watch the Brass Alarm Bell reconstruct work from SQLite.
ALARM() WAKE → SCAN SQLITE MAX(NOW+15s, MIN) OPS IDLE durability_calls CLICK TO SCHEDULE FANOUT IDLE fanout_deliveries CLICK TO SCHEDULE OUTBOX +25s durability_outbox SQLITE • ARMED MIN ★ ALARMS +60s durability_alarms SQLITE • ARMED MIN +25s ENGINE.TX • MIN(DUE) IN-MEMORY HEAP 1 TIMER IDLE (<15s) 1 TIMER • WIPED ON EVICT 1 DO ALARM SURVIVES EVICT ctx.storage.setAlarm() ARMED +25s ≥15s FLOOR • COCKED 2 / 10 FIFO RAM 14m HANDOFF CLUTCH READY PROMISE KEPT • 0 DOUBLE-RUN TX RECONCILE MIN(DUE) IN 1 TX CAPABILITIES 4 TABLES (CLICK) 0 JOB TABLES SQLITE SURVIVES BALANCE WHEEL <15s HEAP • RAM 1 MASTER BELL SETALARM() ≥15s SURVIVES EVICT WAKES DO + SCANS FIFO BARREL 10 CONCURRENCY 14M HANDOFF BEFORE 15M LIMIT
GUARANTEE: 1 SHARED DO ALARM (MIN DUE) • 0 SCHEDULER JOB TABLES
SPEC // 02 [ ARCHITECTURE ]
01 // What it’s for

Why reach for DurabilityScheduler

Cloudflare gives every Durable Object exactly one physical alarm(). DurabilityScheduler lets you compose operations, fanout, outbox, semaphore, topology, and named alarms inside the same object without fighting over ctx.storage.setAlarm().


02 // How it works

Inside your Durable Object

  1. 01Exact MIN(due) reconciliation: Every registered capability reports its earliest due timestamp; in the same storage transaction, the scheduler arms the single physical alarm for the earliest deadline across all capabilities.
  2. 02Ephemeral vs. durable timing: Short in-memory timers (scheduler.setTimeout()) run on the live isolate and vanish on eviction, while durable capability deadlines survive eviction and wake the DO via its physical alarm.
  3. 03Bounded FIFO execution barrel: alarmConcurrency caps concurrent alarm handlers so a burst of due work never starves memory or RPC pools.
  4. 04Safe 14-minute wall-clock handoff: Long alarm passes yield gracefully before Cloudflare's execution limit and re-arm the physical alarm to resume cleanly.
Storage
Delegated to capabilities
Alarm
Owns the DO's 1 physical alarm
Import
durability