Skip to main content

deadline_middleware

Function deadline_middleware 

Source
pub async fn deadline_middleware(
    __arg0: State<Option<Duration>>,
    request: Request<Body>,
    next: Next,
) -> Response
Expand description

Bound every request by the smaller of the server’s request timeout (the middleware state) and the caller’s x-mentedb-deadline-ms. Past it the request is answered with 504; the handler sees the Deadline and its long loops stop early. A malformed header is a 400.