2 unstable releases

0.2.0 Jan 14, 2022
0.1.0 Mar 26, 2019

#712 in Unix APIs

Download history 2097/week @ 2024-03-02 2505/week @ 2024-03-09 3015/week @ 2024-03-16 2907/week @ 2024-03-23 1776/week @ 2024-03-30 589/week @ 2024-04-06 697/week @ 2024-04-13 568/week @ 2024-04-20 960/week @ 2024-04-27 876/week @ 2024-05-04 977/week @ 2024-05-11 1050/week @ 2024-05-18 996/week @ 2024-05-25 903/week @ 2024-06-01 926/week @ 2024-06-08 770/week @ 2024-06-15

3,767 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–14MB
~162K SLoC