mirror of
https://github.com/fawney19/Aether.git
synced 2026-10-08 10:27:46 +08:00
refactor(workspace): enforce layered crate boundaries
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
#[cfg(unix)]
|
||||
pub async fn wait_for_shutdown_signal() -> Result<(), std::io::Error> {
|
||||
use tokio::signal::unix::{signal, SignalKind};
|
||||
|
||||
let mut terminate = signal(SignalKind::terminate())?;
|
||||
tokio::select! {
|
||||
_ = tokio::signal::ctrl_c() => Ok(()),
|
||||
_ = terminate.recv() => Ok(()),
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(not(unix))]
|
||||
pub async fn wait_for_shutdown_signal() -> Result<(), std::io::Error> {
|
||||
tokio::signal::ctrl_c().await
|
||||
}
|
||||
Reference in New Issue
Block a user