rig-ecs 0.44.0

rig inside a Bevy World: effects as entities, handlers as entities, the driver as a system.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#![allow(clippy::unwrap_used)]
use super::*;

/// A finished task raises the wake; a runner waiting on it returns at once,
/// and an untouched wake times out as not raised.
#[test]
fn the_wake_is_raised_by_signal_and_taken_by_wait() {
    let wake = Wake::default();
    assert!(!wake.wait(Duration::from_millis(1)));
    let raiser = wake.clone();
    std::thread::spawn(move || raiser.signal());
    assert!(wake.wait(Duration::from_secs(5)));
    assert!(!wake.take(), "wait took the signal");
}