feat(tui): adopt an asynchronous Tokio runtime for the TUI frontend

Refactor TUI event handling and rendering to improve responsiveness and use a unified managed client worker.
This commit is contained in:
Nils Andreas Svee committed 2026-10-05 21:49:36 +07:00
1 parent 66abb792ce
commit 5067ceeb1c
12 files changed
+508 -266

No files matched your search

+4 -4
View File
@@ -1,18 +1,18 @@
#[cfg(any(feature = "server", feature = "tui"))]
#[cfg(feature = "server")]
use std::sync::{
atomic::{AtomicBool, Ordering},
Arc,
};
#[cfg(any(feature = "server", feature = "tui"))]
#[cfg(feature = "server")]
pub fn install_signal_handler(shutdown_requested: Arc<AtomicBool>) -> Result<(), ctrlc::Error> {
ctrlc::set_handler(move || {
shutdown_requested.store(true, Ordering::Relaxed);
})
}
/// Preserve ctrlc's SIGINT/SIGTERM policy while waking the async client.
#[cfg(feature = "client")]
/// Preserve ctrlc's SIGINT/SIGTERM policy while waking the async frontends.
#[cfg(any(feature = "client", feature = "tui"))]
pub fn install_async_signal_handler() -> Result<tokio::sync::watch::Receiver<bool>, ctrlc::Error> {
let (shutdown, receiver) = tokio::sync::watch::channel(false);
ctrlc::set_handler(move || {