summaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/main.rs b/src/main.rs
index 66835b6..d390b39 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -1,5 +1,5 @@
-use tokio::signal::unix::{signal, SignalKind};
-use tokio::{time::interval, time::Duration};
+use tokio::signal::unix;
+use tokio::time;
const ADV_INTERVAL: u64 = 3;
const SKEW_INTERVAL: u64 = 1;
@@ -19,21 +19,22 @@ async fn sighup_handler() {
#[tokio::main(flavor = "current_thread")]
async fn main() {
let advert_handle = tokio::spawn(async move {
- let mut advert_interval = interval(Duration::from_secs(ADV_INTERVAL));
+ let mut advert_interval = time::interval(time::Duration::from_secs(ADV_INTERVAL));
loop {
advert_interval.tick().await;
advert_handler().await;
}
});
let skew_handle = tokio::spawn(async move {
- let mut skew_interval = interval(Duration::from_secs(SKEW_INTERVAL));
+ let mut skew_interval = time::interval(time::Duration::from_secs(SKEW_INTERVAL));
loop {
skew_interval.tick().await;
skew_handler().await;
}
});
let sighup_handle = tokio::spawn(async move {
- let mut stream = signal(SignalKind::hangup()).expect("Should be a signal stream");
+ let mut stream =
+ unix::signal(unix::SignalKind::hangup()).expect("Should be a signal stream");
loop {
stream.recv().await;
sighup_handler().await;