mirror of
https://github.com/OMGeeky/tarpc.git
synced 2026-02-23 15:49:54 +01:00
Use tokio::time::delay_for in lieu of thread::sleep.
This commit is contained in:
@@ -16,7 +16,6 @@ use std::{
|
|||||||
net::SocketAddr,
|
net::SocketAddr,
|
||||||
pin::Pin,
|
pin::Pin,
|
||||||
sync::{Arc, Mutex},
|
sync::{Arc, Mutex},
|
||||||
thread,
|
|
||||||
time::Duration,
|
time::Duration,
|
||||||
};
|
};
|
||||||
use subscriber::Subscriber as _;
|
use subscriber::Subscriber as _;
|
||||||
@@ -188,7 +187,8 @@ async fn main() -> io::Result<()> {
|
|||||||
.broadcast(context::current(), "hi again".to_string())
|
.broadcast(context::current(), "hi again".to_string())
|
||||||
.await?;
|
.await?;
|
||||||
|
|
||||||
thread::sleep(Duration::from_millis(100));
|
tokio::time::delay_for(Duration::from_millis(100)).await;
|
||||||
|
println!("Done.");
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user