kompact 0.12.0

Kompact is a Rust implementation of the Kompics component model combined with the Actor model.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use std::{
    thread,
    time::{Duration, Instant},
};

pub use kompact::test_support::build_test_kompact_system as build_test_system;

/// Wait until `predicate` returns true or panic after `timeout`.
pub fn eventually(name: &str, timeout: Duration, predicate: impl Fn() -> bool) {
    let deadline = Instant::now() + timeout;
    while Instant::now() < deadline {
        if predicate() {
            return;
        }
        thread::sleep(Duration::from_millis(10));
    }
    panic!("timed out waiting for {name}");
}