ic-cdk-timers 0.2.0

Timers library for the Rust CDK.
ic-cdk-timers-0.2.0 has been yanked.
Visit the last successful build: ic-cdk-timers-1.0.0

Rust CDK Timers Library

Documentation Crates.io License Downloads CI

This crate provides a library to schedule multiple and periodic tasks on the Internet Computer.

Example

In Cargo.toml:

[dependencies]
ic-cdk-timers = "0.1.1"

To schedule a one-shot task to be executed 1s later:

ic_cdk_timers::set_timer(Duration::from_secs(1), || ic_cdk::println!("Hello from the future!"));

References

  1. Internet Computer Developer Guide: Periodic Tasks and Timers
  2. Example: Periodic Tasks and Timers (compares timers and heartbeats).