#signal #future #tetsy #fire #exit #event-loop #fired

tetsy-exit-future

Tetsy Future that signals exit to many receivers

Show the crate…

1 unstable release

0.2.0 Feb 24, 2021

#32 in #event-loop

42 downloads per month
Used in 23 crates (via tc-service)

MIT license

6KB
124 lines

Tetsy Exit Future

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) = tetsy_exit_future::signal();

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

let _ = signal.fire(); // also would fire on drop.

Dependencies

~0.6–0.8MB
~15K SLoC