2 unstable releases

0.2.0 Jan 14, 2022
0.1.0 Mar 26, 2019

#648 in Unix APIs

Download history 715/week @ 2023-12-06 717/week @ 2023-12-13 443/week @ 2023-12-20 380/week @ 2023-12-27 723/week @ 2024-01-03 924/week @ 2024-01-10 1285/week @ 2024-01-17 1646/week @ 2024-01-24 1220/week @ 2024-01-31 1635/week @ 2024-02-07 1818/week @ 2024-02-14 2108/week @ 2024-02-21 2250/week @ 2024-02-28 2222/week @ 2024-03-06 2729/week @ 2024-03-13 2372/week @ 2024-03-20

10,017 downloads per month
Used in 9 crates (3 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–15MB
~171K SLoC