1
0
mirror of https://github.com/fafhrd91/actix-net synced 2025-06-26 15:07:43 +02:00

feat: server shutdown signal (#676)

This commit is contained in:
Rob Ede
2025-05-09 19:30:11 +01:00
committed by GitHub
parent 270360e095
commit 064da0e3ff
14 changed files with 470 additions and 292 deletions

View File

@ -187,10 +187,7 @@ impl SystemRunner {
match exit_code {
0 => Ok(()),
nonzero => Err(io::Error::new(
io::ErrorKind::Other,
format!("Non-zero exit code: {}", nonzero),
)),
nonzero => Err(io::Error::other(format!("Non-zero exit code: {}", nonzero))),
}
}
@ -199,8 +196,7 @@ impl SystemRunner {
let SystemRunner { rt, stop_rx, .. } = self;
// run loop
rt.block_on(stop_rx)
.map_err(|err| io::Error::new(io::ErrorKind::Other, err))
rt.block_on(stop_rx).map_err(io::Error::other)
}
/// Retrieves a reference to the underlying [Actix runtime](crate::Runtime) associated with this