mirror of
https://github.com/edera-dev/krata.git
synced 2025-08-03 13:11:31 +00:00
krata: reorganize crates
This commit is contained in:
15
crates/kratanet/examples/autonet.rs
Normal file
15
crates/kratanet/examples/autonet.rs
Normal file
@ -0,0 +1,15 @@
|
||||
use std::time::Duration;
|
||||
|
||||
use anyhow::Result;
|
||||
use kratanet::autonet::AutoNetworkCollector;
|
||||
use tokio::time::sleep;
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() -> Result<()> {
|
||||
let mut collector = AutoNetworkCollector::new().await?;
|
||||
loop {
|
||||
let changeset = collector.read_changes().await?;
|
||||
println!("{:?}", changeset);
|
||||
sleep(Duration::from_secs(2)).await;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user