Expand description
Live timer scheduling and callback dispatch.
§Scheduling
Runtime deadlines use the remaining duration to the nominal schedule and are computed before
the timer task is spawned. A deadline already in the past starts immediately. Event timestamps
retain the nominal schedule, and stop times are inclusive. An event whose following schedule is
not representable in [UnixNanos] is the timer’s final event.
§Task lifecycle
Each LiveTimer::start creates fresh public schedule and task-state atomics. Because aborting
a runtime task does not join it, task retirement linearizes restart, cancellation, and drop
against event reservation. Retirement either prevents the old task from dispatching, or observes
what that task reserved with its event: the following schedule, or terminal exhaustion when no
successor is representable. Fresh atomics keep that task from overwriting its replacement’s
schedule.
§Callback dispatch
Thread-safe callbacks cross the worker boundary as TimeEventMessage values. RustLocal
callbacks remain in an owner-thread registry and cross the boundary only through tokens and
leases. Senderless Python callbacks run inline and publish their following schedule, when one
exists, after the callback returns.
Structs§
- Live
Timer - A live timer for use with a
LiveClock.