Expand description
Observable and recovery-aware timer primitives for Internet Computer canisters.
ic-timers is a higher-level wrapper around ic-cdk-timers, which remains
the provider that arms and clears platform timers. This crate adds
bounded coordination, scheduling, and observation above it.
The 0.3 runtime executes Once, after-completion, and pre-armed
synchronous watchdog callbacks through one volatile canister-local registry.
Consumers retain durable application authority and synchronously reconstruct
desired registrations during their existing lifecycle hooks.
Re-exports§
pub use schedule::ScheduleError;pub use schedule::TimerCadence;pub use schedule::TimerDirective;pub use schedule::TimerSchedule;pub use snapshot::DeclarationLifetime;pub use snapshot::InactiveReason;pub use snapshot::MAX_TIMER_LABEL_BYTES;pub use snapshot::MeasurementSummary;pub use snapshot::OrdinaryRuntimeStateSnapshot;pub use snapshot::TimerCompletion;pub use snapshot::TimerCompletionOutcome;pub use snapshot::TimerControlFailure;pub use snapshot::TimerCounters;pub use snapshot::TimerDirectiveSnapshot;pub use snapshot::TimerEpoch;pub use snapshot::TimerIdentity;pub use snapshot::TimerIdentityError;pub use snapshot::TimerIdentityField;pub use snapshot::TimerLabel;pub use snapshot::TimerLabelError;pub use snapshot::TimerLastOutcome;pub use snapshot::TimerObservabilitySnapshot;pub use snapshot::TimerOutcomeSnapshot;pub use snapshot::TimerPerformance;pub use snapshot::TimerPolicy;pub use snapshot::TimerProcessCondition;pub use snapshot::TimerRegistrationStatus;pub use snapshot::TimerRunResult;pub use snapshot::TimerRuntimeStateSnapshot;pub use snapshot::TimerSchedulingMode;pub use snapshot::TimerSnapshot;pub use snapshot::WatchdogAttemptSnapshot;pub use snapshot::WatchdogAttemptStatus;pub use snapshot::WatchdogDecision;pub use snapshot::WatchdogRunResult;pub use snapshot::WatchdogRuntimeStateSnapshot;
Modules§
- schedule
- Checked cadence and scheduling decisions.
- snapshot
- Provider-neutral identity and coherent canonical snapshot values.
Structs§
- After
Completion Registration - Opaque non-clone claim for one after-completion callback.
- Once
Registration - Opaque non-clone claim for one registered
Oncecallback. - Timer
Context - Delegated exact registration capability passed to consumer work.
- Watchdog
Registration - Opaque non-clone claim for one pre-armed watchdog callback.
Enums§
- Register
Error - Failure to claim one canonical timer identity.
- Timer
Error - Failure from the canister-local timer runtime API.
- Timer
Reconcile State - Desired volatile scheduling state during synchronous lifecycle reconciliation.
Constants§
- MAX_
TIMER_ REGISTRATIONS - Maximum declarations owned by one canonical registry.
Functions§
- consecutive_
expected_ failures - Return functional expected-failure state by identity without a full inventory.
- initialize_
runtime - Initialize the volatile canister-local runtime once for this Wasm instance.
- reconcile_
after_ completion - Reconstruct or reconcile one after-completion declaration synchronously.
- reconcile_
once - Reconstruct or reconcile one
Oncedeclaration synchronously. - reconcile_
watchdog - Reconstruct or reconcile one watchdog declaration synchronously.
- register_
after_ completion - Register one asynchronous fixed-cadence after-completion callback.
- register_
once - Register one asynchronous
Oncecallback without scheduling it. - register_
watchdog - Register one synchronous pre-armed watchdog callback without scheduling it.
- timer_
snapshot - Return one coherent inert snapshot by identity.
- timer_
snapshots - Return the complete bounded inventory in deterministic identity order.
Type Aliases§
- Timer
Future - Erased future returned by an ordinary timer callback.