2 unstable releases

0.2.0 Jan 14, 2022
0.1.0 Mar 26, 2019

#411 in Unix APIs

Download history 620/week @ 2024-07-21 733/week @ 2024-07-28 923/week @ 2024-08-04 709/week @ 2024-08-11 670/week @ 2024-08-18 639/week @ 2024-08-25 688/week @ 2024-09-01 586/week @ 2024-09-08 692/week @ 2024-09-15 943/week @ 2024-09-22 956/week @ 2024-09-29 3700/week @ 2024-10-06 6774/week @ 2024-10-13 8025/week @ 2024-10-20 6286/week @ 2024-10-27 5755/week @ 2024-11-03

27,193 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–13MB
~165K SLoC