#exit #signal #future #dropped #tetsy #coordinate #cloneable

tetsy-exit-future

Tetsy Future that signals exit to many receivers

Show the crate…

1 unstable release

0.2.0 Feb 24, 2021

#9 in #cloneable

Download history 18/week @ 2024-06-15 26/week @ 2024-06-22 6/week @ 2024-06-29 2/week @ 2024-07-06 23/week @ 2024-07-13 17/week @ 2024-07-20 20/week @ 2024-07-27 20/week @ 2024-08-03 12/week @ 2024-08-10 13/week @ 2024-08-17 14/week @ 2024-08-24 8/week @ 2024-08-31 9/week @ 2024-09-07 14/week @ 2024-09-14 32/week @ 2024-09-21 32/week @ 2024-09-28

88 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
~15K SLoC