2 unstable releases

0.2.0 Jan 14, 2022
0.1.0 Mar 26, 2019

#367 in Unix APIs

Download history 95/week @ 2023-01-26 72/week @ 2023-02-02 114/week @ 2023-02-09 63/week @ 2023-02-16 150/week @ 2023-02-23 68/week @ 2023-03-02 107/week @ 2023-03-09 100/week @ 2023-03-16 78/week @ 2023-03-23 84/week @ 2023-03-30 56/week @ 2023-04-06 371/week @ 2023-04-13 721/week @ 2023-04-20 630/week @ 2023-04-27 937/week @ 2023-05-04 769/week @ 2023-05-11

3,190 downloads per month
Used in 2 crates (via tokio-udt)

MIT license

17KB
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

~3.5–9.5MB
~155K SLoC