Struct tokio_timer::Builder [] [src]

pub struct Builder { /* fields omitted */ }

Configures and builds a Timer

A Builder is obtained by calling wheel().

Methods

impl Builder
[src]

Set the timer tick duration.

See the crate docs for more detail.

Defaults to 100ms.

Set the number of slots in the timer wheel.

The number of slots must be a power of two.

See the crate docs for more detail.

Defaults to 4,096.

Set the initial capacity of the timer

The timer's timeout storage vector will be initialized to this capacity. When the capacity is reached, the storage will be doubled until max_capacity is reached.

Default: 128

Set the max capacity of the timer

The timer's timeout storage vector cannot get larger than this capacity setting.

Default: 4,194,304

Set the max timeout duration that can be requested

Setting the max timeout allows preventing the case of timeout collision in the hash wheel and helps guarantee optimial runtime characteristics.

See the crate docs for more detail.

Defaults to num_slots * tick_duration

Set the timer communication channel capacity

The timer channel is used to dispatch timeout requests to the timer thread. In theory, the timer thread is able to drain the channel at a very fast rate, however it is always possible for the channel to fill up.

This setting indicates the max number of timeout requests that are able to be buffered before timeout requests are rejected.

Defaults to 128

Set the name for the spawned thread.

See also the runtime details in crate docs.

Defaults to "tokio-timer".

Build the configured Timer and return a handle to it.

Trait Implementations

impl Debug for Builder
[src]

Formats the value using the given formatter.