async-ify xenstore and xenclient

This commit is contained in:
alex committed 2024-02-23 04:37:53 +00:00
1 parent cf0b62c9f5
commit 79acf4e814
15 files changed
+395 -294

No files matched your search

+7 -5
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;
}
}