[][src]Crate tokio_timer

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

clock

A configurable source of time.

delay_queue

A queue of delayed elements.

throttle

Slow down a stream by enforcing a delay between items.

timeout

Allows a future or stream to execute for a maximum amount of time.

timer

Timer implementation.

Structs

Delay

A future that completes at a specified instant in time.

DelayQueue

A queue of delayed elements.

Error

Errors encountered by the timer implementation.

Interval

A stream representing notifications at fixed interval

Timeout

Allows a Future or Stream to execute for a limited amount of time.

Functions

sleep

Create a Future that completes in duration from now.

with_default

Set the default timer for the duration of the closure.