Struct ferris::CopyWheel [] [src]

pub struct CopyWheel<T: Eq + Hash + Debug + Clone> { /* fields omitted */ }

This wheel maintains a copy of the timer key in both the appropriate inner timer wheel slot and the global hashset. This does not require an allocation for each timer but may use more memory than an CopyWheel depending upon the size of the keys. When the expiry for a slot occurs, the global hashmap is checked for the expiring keys. If they are still there it means they are valid to expire, otherwise they have already been cancelled.

The minimum duration of a timer is 1 ms. The maximum duration of a timer is 1 day.

Methods

impl<T: Eq + Hash + Debug + Clone> CopyWheel<T>
[src]

[src]

Create a set of hierarchical inner wheels

The wheel must be driven by calling expire at the maximum resolution. For example if the maximum resolution is 10ms, then expire must be called every 10ms.

The maximum value of the wheel is its minimum resolution times the number of slots in that resolution's wheel. For example if the maximum resolution is 1 second then the max timer that may be represented is 1 minute, since the second wheel always only contains 60 slots. If larger timer durations are desired, the user should add another, lower resolution. The absolute maximum timer duration is 1 day.

Trait Implementations

impl<T: Eq + Hash + Debug + Clone> Wheel<T> for CopyWheel<T>
[src]

[src]

Start a timer with the given duration.

[src]

Cancel a timer.

[src]

Return any expired timer keys