Skip to main content

Module run

Module run 

Source
Expand description

Daemon main loop: spawns hyperd, runs health listener, monitors hyperd liveness and optional idle timeout, restarts hyperd if it dies.

By default, the daemon never auto-shuts down due to inactivity (opt-in via --idle-timeout flag or HYPERDB_DAEMON_IDLE_TIMEOUT env var). When enabled, client HEARTBEAT commands reset the idle timer (see DaemonState).

Structs§

DaemonConfig
Configuration for the daemon process.

Enums§

RestartAttempt
Outcome of a single rate-limit check on the restart-history vector.

Constants§

RESTART_LIMIT
RESTART_WINDOW
Restart-attempt rate limit: at most 3 attempts within this window. The 4th attempt within the window is rejected and triggers daemon shutdown.

Functions§

run_daemon
Run the daemon. This function blocks until shutdown is triggered.
try_record_restart_attempt
Prune restart-history entries older than RESTART_WINDOW, then either record now as a new attempt or report that the limit is already exceeded.