use tokio::sync::broadcast;
pub struct Shutdown {
is_shutdown: bool,
notify: broadcast::Receiver<()>,
}
use tokio::time::{sleep, Duration};
async fn fetch_data() -> String {
sleep(Duration::from_millis(100)).await;
"data".to_string()
}
use notify::{Event, RecommendedWatcher, RecursiveMode, Watcher};
use std::path::{Path, PathBuf};
use std::sync::mpsc;
pub fn spawn_watcher(root: &Path) -> notify::Result<(RecommendedWatcher, flume::Receiver<PathBuf>)> {
let (raw_tx, raw_rx) = mpsc::channel::<notify::Result<Event>>();