web.rs - HTTP Interface
Global Event Broadcasting System
// src/web.rs (lines 10-22)
// Global broadcast channel for log lines / events
pub static EVENT_TX: Lazy<Sender<String>> = Lazy::new(|| {
let (tx, _rx) = channel(100);
tx
});
/// Broadcast helper prints to stdout and pushes to SSE listeners
pub fn broadcast<S: Into<String>>(msg: S) {
let text: String = msg.into();
println!("{}", text);
let _ = EVENT_TX.send(text);
}