2 unstable releases

0.1.0 Nov 11, 2022
0.0.0 Sep 28, 2022

#1079 in Data structures

Download history 76/week @ 2024-07-22 173/week @ 2024-07-29 165/week @ 2024-08-05 134/week @ 2024-08-12 154/week @ 2024-08-19 159/week @ 2024-08-26 135/week @ 2024-09-02 83/week @ 2024-09-09 112/week @ 2024-09-16 155/week @ 2024-09-23 1646/week @ 2024-09-30 2169/week @ 2024-10-07 3749/week @ 2024-10-14 3532/week @ 2024-10-21 4456/week @ 2024-10-28 4938/week @ 2024-11-04

16,717 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