feat: move to async POSIX signal handler

Instead of trying to handle signals for every step of the `cursive`
event loop, move the signal handling into its own asynchronous task and
send callbacks to `cursive` when a signal arrives.
This commit is contained in:
Thomas Frans
2023-10-07 18:34:49 +02:00
committed by Henrik Friedrichsen
parent 209d8e260b
commit a067ab2ae2
3 changed files with 49 additions and 15 deletions

13
Cargo.lock generated
View File

@@ -1985,6 +1985,7 @@ dependencies = [
"serde_cbor",
"serde_json",
"signal-hook",
"signal-hook-tokio",
"strum",
"strum_macros",
"tokio",
@@ -3267,6 +3268,18 @@ dependencies = [
"libc",
]
[[package]]
name = "signal-hook-tokio"
version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "213241f76fb1e37e27de3b6aa1b068a2c333233b59cca6634f634b80a27ecf1e"
dependencies = [
"futures-core",
"libc",
"signal-hook",
"tokio",
]
[[package]]
name = "slab"
version = "0.4.9"