fn construct_watcher(
tx: UnboundedSender<Result<Event>>,
) -> (Option<Box<dyn Watcher + Send>>, WatchBackend)Expand description
Build the watcher backend: prefer the native OS backend
(inotify/FSEvents/ReadDirectoryChangesW); fall back to notify‘s
stat-based PollWatcher if the native backend can’t even construct
(practically never on the platforms AgentMux ships for, but real on some
restricted/containerized environments). Returns (None, Native) only if
both fail to construct — recorded as WatchBackend::Native since that
was the attempted backend; every subscribe_* call will immediately
fail into degraded_paths until the process restarts, matching the
existing three watchers’ “live-update becomes unavailable, nothing else
breaks” posture, just now with a health signal instead of silence.