Skip to main content

run_shutdown_sequence

Function run_shutdown_sequence 

Source
pub fn run_shutdown_sequence(
    listener: &mut ServerListener,
    websocket_listener: Option<&mut WebSocketListener>,
    supervisor: &ConnectionSupervisor,
    drain_timeout: Duration,
) -> Result<(), ServerError>
Expand description

Runs the graceful shutdown sequence after the handle has been activated.

The optional sibling WebSocket listener (LP-WS-TRANSPORT R1) stops accepting — and interrupts its in-flight upgrade handshakes — in the same pre-notification window as the main listener, so no connection on EITHER transport can slip past the shutdown broadcast. Already-admitted WebSocket connections live in the shared supervisor and are drained/force-closed by the same sequence below.

§Errors

Returns ServerError when stop-accepting or durable flush fails.