tk-easyloop 0.1.1

A thread local loop and other loop helpers
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
extern crate futures;
extern crate tk_easyloop;

use std::time::Duration;
use futures::Future;
use tk_easyloop::{run, timeout};

fn main() {

    run(|| {
        println!("Sleeping 1 second");
        timeout(Duration::new(1, 0))
        .and_then(|()| {
            println!("Done");
            Ok(())
        })
    }).unwrap();
}