Crates.io | timer-queue |
lib.rs | timer-queue |
version | 0.1.0 |
source | src |
created_at | 2022-09-28 04:05:34.670803 |
updated_at | 2022-11-11 17:31:04.31013 |
description | Pure, minimal, and scalable timers |
homepage | |
repository | https://github.com/Ralith/timer-queue |
max_upload_size | |
id | 675409 |
size | 42,873 |
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"));
Licensed under any of
at your option.
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.