2 unstable releases

0.1.0 Nov 11, 2022
0.0.0 Sep 28, 2022

#1224 in Data structures

Download history 1172/week @ 2024-01-07 1169/week @ 2024-01-14 1103/week @ 2024-01-21 807/week @ 2024-01-28 809/week @ 2024-02-04 1142/week @ 2024-02-11 967/week @ 2024-02-18 580/week @ 2024-02-25 157/week @ 2024-03-03 146/week @ 2024-03-10 141/week @ 2024-03-17 159/week @ 2024-03-24 206/week @ 2024-03-31 191/week @ 2024-04-07 162/week @ 2024-04-14 149/week @ 2024-04-21

723 downloads per month

MIT OR Apache-2.0 OR Zlib

27KB
445 lines

timer-queue

License: Apache 2.0 License: MIT License: Zlib

A pure, minimal, and scalable structure for tracking expiration of timers

let mut q = TimerQueue::new();
q.insert(42, "second");
q.insert(17, "first");
assert!(q.next_timeout().unwrap() <= 17);
assert_eq!(q.poll(16), None);
assert_eq!(q.poll(17), Some("first"));
assert_eq!(q.poll(100), Some("second"));

License

Licensed under any of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be triple licensed as above, without any additional terms or conditions.

Dependencies

~45KB