run_daemon_loop

Function run_daemon_loop 

Source
pub async fn run_daemon_loop<H>(
    config: DaemonConfig,
    handler: H,
) -> Result<(), PluginError>
where H: DaemonHandler,
Expand description

Run the daemon event loop

This function:

  1. Sets up the socket listener
  2. Calls on_start on the handler
  3. Runs the main event loop, handling:
    • Incoming client connections
    • Periodic tick events
  4. Calls on_shutdown when the daemon exits

§Arguments

  • config - Daemon configuration (socket path, intervals, etc.)
  • handler - The daemon handler implementing the business logic

§Returns

Returns an error if socket setup fails or a fatal error occurs.