Skip to main content

Module scheduler

Module scheduler 

Source
Expand description

BTreeMap-based scheduler with immediate-remove cancellation.

Three indexed tables maintained in lockstep:

  • ready: BTreeMap<SchedKey, ScheduledEntry> — primary execution queue, ordered by (at, seq, id).
  • by_id: BTreeMap<ScheduledActionId, SchedKey> — O(log n) cancel lookup.
  • by_actor: BTreeMap<EntityId, BTreeSet<ScheduledActionId>> — O(k log n) actor-scoped cancel.

No tombstones — cancel immediately removes from all three tables. Determinism: BTreeMap iteration order is total over SchedKey, and seq is monotonic per kernel lifetime, so identical schedule sequences produce identical pop_due streams (deterministic).

Structs§

ScheduledActionId
Sentinel-free scheduled-action handle (A6).