exit-future 0.1.0

Future that signals exit to many receivers
Documentation

Documentation


Create a Signal and cloneable Exit future that fires when Signal is fired or dropped. Used to coordinate exit between multiple event-loop threads.

let (signal, exit) = exit_future::signal();

::std::thread::spawn(move || {
    // future resolves when signal fires
    exit.wait().unwrap();
});

signal.fire(); // also would fire on drop.