1
0
mirror of https://github.com/bspeice/aeron-rs synced 2024-12-22 13:58:09 -05:00
aeron-rs/examples/aeronmd.rs

23 lines
644 B
Rust
Raw Normal View History

//! 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();
}
}