Expand description
Discovery file management for the single-instance daemon.
The daemon writes a JSON file to ~/.hyperdb/daemon.json containing its
PID and the hyperd endpoint. Clients read this file to locate the running
daemon, validating liveness via a TCP health check before trusting it.
Structs§
- Daemon
Info - Information written by the daemon so clients can discover and connect.
Functions§
- discover
- Read the discovery file and validate that the daemon is still alive.
Returns
Noneif no daemon is running (file missing, stale, or unreachable). - discovery_
file_ path - Returns the path to the discovery file.
- remove_
discovery_ file - Remove the discovery file (called during graceful shutdown).
- resolve_
port - Resolve the daemon health port from environment or default.
- state_
dir - Returns the directory used for daemon state files.
- write_
discovery_ file - Write the discovery file atomically (write-to-temp then rename).