async-ify xenstore and xenclient

This commit is contained in:
Alex Zenla
2024-02-23 04:37:53 +00:00
parent cf0b62c9f5
commit 79acf4e814
15 changed files with 395 additions and 294 deletions

View File

@ -1,13 +1,15 @@
use std::{thread::sleep, time::Duration};
use std::time::Duration;
use anyhow::Result;
use kratanet::autonet::AutoNetworkCollector;
use tokio::time::sleep;
fn main() -> Result<()> {
let mut collector = AutoNetworkCollector::new()?;
#[tokio::main]
async fn main() -> Result<()> {
let mut collector = AutoNetworkCollector::new().await?;
loop {
let changeset = collector.read_changes()?;
let changeset = collector.read_changes().await?;
println!("{:?}", changeset);
sleep(Duration::from_secs(2));
sleep(Duration::from_secs(2)).await;
}
}