pub async fn await_exit(must_exit: Receiver<bool>)
Expand description

This async function returns only when a true signal was received from a watcher that tells us when to exit.

Usefull in a select statement to interrupt another future:

select!(
    _ = a_long_task() => Success,
    _ = await_exit(must_exit) => Interrupted,
)