mirror of
https://github.com/edera-dev/krata.git
synced 2026-11-04 21:22:20 +00:00
async-ify xenstore and xenclient
This commit is contained in:
15 files changed
+395
-294
No files matched your search
@@ -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;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user