2 unstable releases

0.2.0 Jan 14, 2022
0.1.0 Mar 26, 2019

#432 in Unix APIs

Download history 2213/week @ 2024-11-16 2120/week @ 2024-11-23 1738/week @ 2024-11-30 2349/week @ 2024-12-07 1710/week @ 2024-12-14 372/week @ 2024-12-21 605/week @ 2024-12-28 1275/week @ 2025-01-04 2031/week @ 2025-01-11 2122/week @ 2025-01-18 2090/week @ 2025-01-25 2864/week @ 2025-02-01 2242/week @ 2025-02-08 2979/week @ 2025-02-15 3054/week @ 2025-02-22 2446/week @ 2025-03-01

11,111 downloads per month
Used in 10 crates (4 directly)

MIT license

18KB
379 lines

tokio-timerfd

Linux timerfd for Tokio.

This crates provides tokio-timer-like API on top of timerfd. timerfd is a Linux-specific API providing timer notifications as file descriptor read events.

The advantage of timerfd is that it has more granularity than epoll_wait(), which only provides 1 millisecond timeouts. timerfd API allows for nanosecond precision, but precise timing of the wakeup is not guaranteed on a normal multitasking system.


lib.rs:

This crates provides tokio-timer-like API on top of timerfd. timerfd is a Linux-specific API providing timer notifications as file descriptor read events.

The advantage of timerfd is that it has more granularity than epoll_wait(), which only provides 1 millisecond timeouts. timerfd API allows for nanosecond precision, but precise timing of the wakeup is not guaranteed on a normal multitasking system.

Despite the name, this crate is not a part of the tokio project.

  • Delay: A future that completes at a specified instant in time.
  • Interval A stream that yields at fixed time intervals.
  • DelayQueue: A queue where items are returned once the requested delay has expired.

Dependencies

~4–14MB
~193K SLoC