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§
- Operation
Guard - Guard for tracking an active operation.
- Shutdown
Config - Shutdown configuration.
- Shutdown
Controller - Controller for coordinating graceful shutdown.
- Shutdown
Signal - Future that resolves when shutdown is initiated.
Functions§
- wait_
for_ signal - Wait for OS shutdown signals (SIGTERM, SIGINT).