Crates.io | tokio-timer-futures2 |
lib.rs | tokio-timer-futures2 |
version | 0.2.1 |
source | src |
created_at | 2018-03-17 03:43:02.471888 |
updated_at | 2018-03-25 21:45:48.585939 |
description | Timer facilities for Tokio |
homepage | https://github.com/tokio-rs/tokio-timer |
repository | https://github.com/asonix/tokio-timer |
max_upload_size | |
id | 56067 |
size | 70,499 |
Timer facilities for Tokio
First, add this to your Cargo.toml
:
[dependencies]
tokio-timer = "0.1"
Next, add this to your crate:
extern crate tokio_timer;
This crate provides timer facilities for usage with Tokio. Currently, the only timer implementation is a hashed timing wheel, but will provide a binary heap based timer at some point.
A timer provides the ability to set a timeout, represented as a future. When the timeout is reached, the future completes. This can be implemented very efficiently and avoiding runtime allocations.
Inspired by the paper by Varghese and Lauck, the hashed timing wheel is a great choice for the usage pattern commonly found when writing network applications.
tokio-timer
is primarily distributed under the terms of both the MIT
license and the Apache License (Version 2.0), with portions covered by
various BSD-like licenses.
See LICENSE-APACHE, and LICENSE-MIT for details.
The MPMC queue implementation is inspired from 1024cores, see LICENSE-MPMC for details.