Skip to content

Commit

Permalink
fix shutdown-signal for non-unix
Browse files Browse the repository at this point in the history
  • Loading branch information
jgraef committed Jul 11, 2024
1 parent 81a874d commit bfb2a09
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 21 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ SKUNK_UI_DEV=1
HOSTAPD_CC=US
```

You can also put your environment variables in a `.env` file.


[1]: https://en.wikipedia.org/wiki/Man-in-the-middle_attack
[2]: https://github.com/jgraef/skunk/issues
[3]: https://trunkrs.dev/
Expand Down
2 changes: 1 addition & 1 deletion skunk-cli/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ fn cancel_on_ctrlc_or_sigterm() -> CancellationToken {
.await;

#[cfg(not(unix))]
futures::future::pending().await;
std::future::pending::<()>().await;
}

tokio::spawn({
Expand Down
22 changes: 2 additions & 20 deletions skunk-util/src/trigger.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
use std::{
future::Future,
pin::Pin,
task::{
Context,
Poll,
},
};
use std::future::pending;

use tokio::sync::watch;

Expand Down Expand Up @@ -47,7 +40,7 @@ impl Receiver {

pub async fn triggered(&mut self) {
if let Err(Closed) = self.triggered_or_closed().await {
Pending.await;
pending::<()>().await;
}
}
}
Expand All @@ -59,14 +52,3 @@ pub fn new() -> (Sender, Receiver) {
let (tx, rx) = watch::channel(());
(Sender { tx }, Receiver { rx })
}

// todo: we could also just import futures_util
struct Pending;

impl Future for Pending {
type Output = ();

fn poll(self: Pin<&mut Self>, _cx: &mut Context<'_>) -> Poll<Self::Output> {
Poll::Pending
}
}

0 comments on commit bfb2a09

Please sign in to comment.