Expand description
The fast and more complicated version of pingora-timeout
The following optimizations are applied:
- The timeouts lazily initialize their timer when the Future is pending for the first time.
- There is no global lock for creating and cancelling timeouts.
- Timeout timers are rounded to the next 10ms tick and timers are shared across all timeouts with the same deadline.
In order for this to work, a standalone thread is created to arm the timers, which has some overhead. As a general rule, the benefits of this don’t outweigh the overhead unless there are more than about 100 timeout() calls/sec in the system. Use regular tokio timeout or super::tokio_timeout in the low usage case.
Structs§
- Fast
Timeout - The timeout generated by fast_timeout().
Functions§
- fast_
sleep - Similar to tokio::time::sleep but more efficient.
- fast_
timeout - Similar to tokio::time::timeout but more efficient.
- pause_
for_ fork - Pause the timer for fork()
- unpause
- Unpause the timer after fork()