use once_cell::sync::Lazy; use std::sync::Arc; use tokio::sync::broadcast; use super::event_bus::EventBus; use crate::watcher::WatcherCommand; pub enum ErrorEvent { } static ERROR_BUS: Lazy>> = Lazy::new(|| Arc::new(EventBus::new())); pub fn publish_error(event: WatcherCommand) { ERROR_BUS.publish(event); } pub fn subscribe_error_bus() -> broadcast::Receiver { ERROR_BUS.subscribe() }