drumbeat 0.1.1

An event handling system aimed towards real-time applications such as GUIs and Game Engines.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use drumbeat::sync::runtime::Runtime;

use std::sync::atomic::{AtomicI32, Ordering};
use std::sync::Arc;

#[test]
fn runtime_test() {
  let counter = Arc::new(AtomicI32::new(0));
  for _ in 0..100 {
    let cloned = counter.clone();
    Runtime::submit(move || {
      cloned.fetch_add(1, Ordering::Relaxed);
    });
  }
  while !Runtime::done() {}
  assert_eq!(counter.load(Ordering::Relaxed), 100);
}