feat: add reactive streaming and remove dead panel stream code

- Subscribe to StreamCascadeReactiveUpdates for real-time cascade state diffs
- Fall back to timer-based polling if streaming RPC unavailable
- Remove StreamCascadePanelReactiveUpdates code (dead end, only has plan_status/user_settings)
- Remove debug diff file-saving code
- Add stream_reactive_rpc() helper to backend
This commit is contained in:
Nikketryhard
2026-02-14 21:39:04 -06:00
parent 3d7a7f492b
commit b965be3f60
3 changed files with 169 additions and 5 deletions

View File

@@ -53,6 +53,19 @@ struct Cli {
#[tokio::main]
async fn main() {
// Ignore SIGPIPE — prevents instant death when piped through tee/grep
#[cfg(unix)]
{
use tokio::signal::unix::{signal, SignalKind};
let mut sigpipe = signal(SignalKind::pipe()).expect("failed to install SIGPIPE handler");
tokio::spawn(async move {
loop {
sigpipe.recv().await;
// Silently ignore SIGPIPE
}
});
}
// Install rustls CryptoProvider early — prevents panic under concurrent load
let _ = rustls::crypto::ring::default_provider().install_default();
@@ -267,6 +280,7 @@ async fn main() {
}
// Remove stale MITM port file
let _ = std::fs::remove_file(dirs_data_dir().join("mitm-port"));
eprintln!(" \x1b[1;32m✓ Server shutdown complete\x1b[0m\n");
info!("Server shutdown complete");
}
@@ -290,8 +304,14 @@ async fn shutdown_signal() {
let terminate = std::future::pending::<()>();
tokio::select! {
_ = ctrl_c => info!("Received SIGINT, shutting down..."),
_ = terminate => info!("Received SIGTERM, shutting down..."),
_ = ctrl_c => {
eprintln!("\n \x1b[1;33m⚡ Shutting down gracefully...\x1b[0m");
info!("Received SIGINT, shutting down...");
},
_ = terminate => {
eprintln!("\n \x1b[1;33m⚡ Received SIGTERM, shutting down...\x1b[0m");
info!("Received SIGTERM, shutting down...");
},
}
}