2 unstable releases

0.2.0 Jan 14, 2022
0.1.0 Mar 26, 2019

#311 in Unix APIs

Download history 747/week @ 2024-06-17 687/week @ 2024-06-24 609/week @ 2024-07-01 625/week @ 2024-07-08 756/week @ 2024-07-15 618/week @ 2024-07-22 735/week @ 2024-07-29 918/week @ 2024-08-05 712/week @ 2024-08-12 656/week @ 2024-08-19 666/week @ 2024-08-26 665/week @ 2024-09-02 594/week @ 2024-09-09 687/week @ 2024-09-16 948/week @ 2024-09-23 1088/week @ 2024-09-30

3,331 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
~167K SLoC