#exit #signal #future #dropped #coordinate #cloneable #thread

tetsy-exit-future

Tetsy Future that signals exit to many receivers

Show the crate…

1 unstable release

0.2.0 Feb 24, 2021

#8 in #cloneable

Download history 12/week @ 2023-12-17 7/week @ 2023-12-24 41/week @ 2024-01-07 9/week @ 2024-01-14 3/week @ 2024-01-21 18/week @ 2024-02-11 23/week @ 2024-02-18 37/week @ 2024-02-25 23/week @ 2024-03-03 27/week @ 2024-03-10 28/week @ 2024-03-17 35/week @ 2024-03-24 55/week @ 2024-03-31

150 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

~1MB
~16K SLoC