Crate tokio_timer

source ·
Expand description

Utilities for tracking time.

This crate provides a number of utilities for working with periods of time:

  • Delay: A future that completes at a specified instant in time.

  • Interval A stream that yields at fixed time intervals.

  • Throttle: Throttle down a stream by enforcing a fixed delay between items.

  • Timeout: Wraps a future or stream, setting an upper bound to the amount of time it is allowed to execute. If the future or stream does not complete in time, then it is canceled and an error is returned.

  • DelayQueue: A queue where items are returned once the requested delay has expired.

These three types are backed by a Timer instance. In order for Delay, Interval, and Timeout to function, the associated Timer instance must be running on some thread.

Re-exports

pub use self::timer::Timer;

Modules

A configurable source of time.
A queue of delayed elements.
Slow down a stream by enforcing a delay between items.
Allows a future or stream to execute for a maximum amount of time.
Timer implementation.

Structs

A future that completes at a specified instant in time.
A queue of delayed elements.
Errors encountered by the timer implementation.
A stream representing notifications at fixed interval
Allows a Future or Stream to execute for a limited amount of time.

Functions

Create a Future that completes in duration from now.
Set the default timer for the duration of the closure.