1
0
mirror of https://github.com/bspeice/aeron-rs synced 2024-11-14 03:58:08 -05:00
aeron-rs/examples/aeronmd.rs
Bradlee Speice adfa401245 Add duty cycle functionality to the media driver
Eventually want to receive term events in tests
2019-10-06 20:45:57 -04:00

23 lines
644 B
Rust

//! A version of the `aeronmd` runner program demonstrating the Rust wrappers
//! around Media Driver functionality.
use aeron_rs::driver::DriverContext;
use std::sync::atomic::{AtomicBool, Ordering};
static RUNNING: AtomicBool = AtomicBool::new(false);
fn main() {
let driver = DriverContext::default()
.build()
.expect("Unable to create media driver");
let driver = driver.start().expect("Unable to start media driver");
RUNNING.store(true, Ordering::SeqCst);
println!("Press Ctrl-C to quit");
while RUNNING.load(Ordering::SeqCst) {
// TODO: Termination hook
driver.do_work();
}
}