Skip to main content

Module timers

Module timers 

Source
Expand description

Partition-local timers, shared by native and Durable Object drivers.

Re-exports§

pub use registry::TimerHandler;
pub use registry::TimerKind;
pub use registry::TimerRegistry;

Modules§

lease_sweep
Expired epoch-lease table cleanup, confined to the coordinator partition.
outcome_delivery
Bounded, at-least-once terminal outcome delivery.
publication_recheck
Durable dependency rechecks. One retained timer per blocked advance avoids an unbounded reverse-dependency fanout when membership publishes across refs.
quota_rollup
Reconcile each ref shard’s cumulative fixed-window quota into its coordinator. The coordinator apply precedes the local view write; a crash between them is safe because qc stores the last applied cumulative count.
registry
Timer kind allocations and startup handler registration.
reservation_reconcile
Reconcile a pending write or read after its safe abandonment deadline.
ticket_expiry
Close due upload tickets and queue one terminal Expired outcome.

Structs§

DueTimer
The row handed to a kind-specific codec and handler.
RunReport
Counts and the next driver wake, never earlier than this tick’s business time.
TickBudget
Work limits shared by every logical partition of one physical tick.
TickState
Physical-tick counters. Fetching a page reserves its rows before processing them, so an exhausted scan allowance does not discard an already read page.
TimerCtx
Reads available to a handler; effects belong in the returned batch.

Enums§

Fired
A handler’s decision, committed by the core.

Constants§

MAX_RETRY_BACKOFF_MS
Largest persisted retry delay, including after an isolate restart.
RETRY_BACKOFF_MS
Delay before retrying failed or unknown timers, avoiding a busy loop.

Functions§

earliest_timer_put
Earliest timer Put in a batch, shared by both driver adapters.
run_due
Fire one partition with its own allowance. Physical drivers should use run_due_with_state and share a single TickState across their heads.
run_due_with_state
Fire a partition without refreshing physical-alarm limits. Scans reserve their returned rows and one portable SQL lookahead row before processing. Retry moves preserve the handler’s original due time and opaque payload.