Class TimeoutDirectives

    • Constructor Detail

      • TimeoutDirectives

        public TimeoutDirectives()
    • Method Detail

      • extractRequestTimeout

        public RouteAdapter extractRequestTimeout​(java.util.function.Function<scala.concurrent.duration.Duration,​Route> inner)
      • withRequestTimeout

        public RouteAdapter withRequestTimeout​(scala.concurrent.duration.Duration timeout,
                                               java.util.function.Supplier<Route> inner)
        Tries to set a new request timeout and handler (if provided) at the same time.

        Due to the inherent raciness it is not guaranteed that the update will be applied before the previously set timeout has expired!

        Parameters:
        timeout - (undocumented)
        inner - (undocumented)
        Returns:
        (undocumented)
      • withRequestTimeout

        public RouteAdapter withRequestTimeout​(scala.concurrent.duration.Duration timeout,
                                               java.util.function.Function<HttpRequest,​HttpResponse> timeoutHandler,
                                               java.util.function.Supplier<Route> inner)
        Tries to set a new request timeout and handler (if provided) at the same time.

        Due to the inherent raciness it is not guaranteed that the update will be applied before the previously set timeout has expired!

        Parameters:
        timeout - (undocumented)
        timeoutHandler - (undocumented)
        inner - (undocumented)
        Returns:
        (undocumented)
      • withRequestTimeoutResponse

        public RouteAdapter withRequestTimeoutResponse​(java.util.function.Function<HttpRequest,​HttpResponse> timeoutHandler,
                                                       java.util.function.Supplier<Route> inner)
        Tries to set a new request timeout handler, which produces the timeout response for a given request. Note that the handler must produce the response synchronously and shouldn't block!

        Due to the inherent raciness it is not guaranteed that the update will be applied before the previously set timeout has expired!

        Parameters:
        timeoutHandler - (undocumented)
        inner - (undocumented)
        Returns:
        (undocumented)
      • withoutRequestTimeout

        public RouteAdapter withoutRequestTimeout​(java.util.function.Supplier<Route> inner)