web_notify
The web server (when running) listens on a unix domain socket. CLI mutations call
notify_web_reload to wake any subscribed browser tabs via SSE. Absence of the
server is the common case and must remain silent and fast.
const CONNECT_TIMEOUT
const CONNECT_TIMEOUT: std::time::Duration = std::time::Duration::from_millis(50);Connect timeout for the reload notifier.
Kept intentionally small so that the absence of a running web server adds no user-visible latency to CLI commands. The notifier never blocks the caller for longer than this on the happy “no server” path.
fn notify_web_reload
pub async fn notify_web_reload(gest_dir: Option<&Path>, data_dir: &Path) -> std::io::Result<()>Notify a running web server that project state has changed.
Resolves the same socket path as crate::web::reload_socket_path and opens a
short-lived UnixStream. No bytes are written or read — the bare connection itself
is the signal. Any error (file missing, refused, timeout) is treated as “no server
running” and silently swallowed.
On non-unix targets this function compiles to a no-op that returns Ok(()).
| Parameter | Type | Description |
|---|---|---|
gest_dir |
Option<&Path> | the project’s .gest directory, if it has one |
data_dir |
&Path | the global data directory, used for the socket when there is no .gest directory |
| returns | std::io::Result<()> | Always Ok(()). |