pub fn new(repo_root: AbsoluteSystemPathBuf) -> Result<FileWatching, WatchError> {
        let watcher = Arc::new(FileSystemWatcher::new_with_default_cookie_dir(&repo_root)?);
        let recv = watcher.watch();

        let cookie_writer = CookieWriter::new(
            watcher.cookie_dir(),
            Duration::from_millis(100),
            recv.clone(),
        );
        let glob_watcher = Arc::new(GlobWatcher::new(
            repo_root.clone(),
            cookie_writer.clone(),
            recv.clone(),
        ));
        let package_watcher = Arc::new(
            PackageWatcher::new(repo_root.clone(), recv.clone(), cookie_writer)
                .map_err(|e| WatchError::Setup(format!("{:?}", e)))?,
        );
        let scm = SCM::new(&repo_root);
        let hash_watcher = Arc::new(HashWatcher::new(
            repo_root.clone(),
            package_watcher.watch_discovery(),
            recv.clone(),
            scm,
        ));

        Ok(FileWatching {
            repo_root,
            watcher,
            glob_watcher,
            package_watcher,
            package_changes_watcher: OnceLock::new(),
            hash_watcher,
        })
    }
This function is called in the constructor for the `TurboGrpcService`
and should defer ALL heavy computation to the background, making use
of `OptionalWatch` to ensure that the server can start up without
waiting for the filewatcher to be ready. Using `OptionalWatch`,
dependent services can wait for resources they need to become
available, and the server can start up without waiting for them.
crates/turborepo-lib/src/daemon/server.rs