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:
12 files changed
+508
-266
No files matched your search
@@ -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 || {
|
||||
|
||||
Reference in new issue
Block a user