mod common;
use common::HelloWorld;
use mmap_sync::synchronizer::Synchronizer;
use std::time::Duration;
fn main() {
let mut synchronizer = Synchronizer::new("/tmp/hello_world".as_ref());
let data = HelloWorld {
version: 7,
messages: vec!["Hello".to_string(), "World".to_string(), "!".to_string()],
};
let (written, reset) = synchronizer
.write(&data, Duration::from_secs(1))
.expect("failed to write data");
println!("written: {} bytes | reset: {}", written, reset);
}