2 unstable releases

0.2.0 Jan 14, 2022
0.1.0 Mar 26, 2019

#351 in Unix APIs

Download history 649/week @ 2024-08-30 577/week @ 2024-09-06 715/week @ 2024-09-13 929/week @ 2024-09-20 840/week @ 2024-09-27 2531/week @ 2024-10-04 6975/week @ 2024-10-11 7828/week @ 2024-10-18 6481/week @ 2024-10-25 5727/week @ 2024-11-01 6728/week @ 2024-11-08 2710/week @ 2024-11-15 2130/week @ 2024-11-22 1833/week @ 2024-11-29 2246/week @ 2024-12-06 1485/week @ 2024-12-13

8,121 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
~170K SLoC