Skip to main content

apply_connection_limit

Function apply_connection_limit 

Source
pub(crate) fn apply_connection_limit(router: Router, limit: usize) -> Router
Expand description

Shared budget: a request holds a slot until its handler returns, excess gets 429. A stream (websocket or SSE) releases its slot once the response starts, so open streams are not capped here, see axum::limit_requests.