Skip to main content

Module shutdown

Module shutdown 

Source
Expand description

Graceful shutdown handling for the xDS server.

This module provides signal handling and graceful shutdown coordination for the xDS server, ensuring in-flight requests complete before termination.

§Example

use xds_server::shutdown::ShutdownController;
use std::time::Duration;

let controller = ShutdownController::new();

// In your server startup
let _shutdown_rx = controller.subscribe();

// When shutdown is triggered
controller.shutdown(Duration::from_secs(30)).await;

Structs§

OperationGuard
Guard for tracking an active operation.
ShutdownConfig
Shutdown configuration.
ShutdownController
Controller for coordinating graceful shutdown.
ShutdownSignal
Future that resolves when shutdown is initiated.

Functions§

wait_for_signal
Wait for OS shutdown signals (SIGTERM, SIGINT).