Interface TimeoutDirectives

All Known Subinterfaces:
Directives
All Known Implementing Classes:
Directives$, HttpApp, TimeoutDirectives$

public interface TimeoutDirectives
  • Method Details

    • extractRequestTimeout

      Directive<scala.Tuple1<scala.concurrent.duration.Duration>> extractRequestTimeout()
      Return the currently set request timeout.

      Note that this may be changed in inner directives.

      Returns:
      (undocumented)
    • withoutRequestTimeout

      Directive<scala.runtime.BoxedUnit> withoutRequestTimeout()
      Returns:
      (undocumented)
    • withRequestTimeout

      Directive<scala.runtime.BoxedUnit> withRequestTimeout(scala.concurrent.duration.Duration timeout)
      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)
      Returns:
      (undocumented)
    • withRequestTimeout

      Directive<scala.runtime.BoxedUnit> withRequestTimeout(scala.concurrent.duration.Duration timeout, scala.Function1<HttpRequest,HttpResponse> handler)
      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:
      handler - optional custom "timeout response" function. If left None, the default timeout HttpResponse will be used.

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

      Directive<scala.runtime.BoxedUnit> withRequestTimeout(scala.concurrent.duration.Duration timeout, scala.Option<scala.Function1<HttpRequest,HttpResponse>> handler)
      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:
      handler - optional custom "timeout response" function. If left None, the default timeout HttpResponse will be used.

      timeout - (undocumented)
      Returns:
      (undocumented)
    • withRequestTimeoutResponse

      Directive<scala.runtime.BoxedUnit> withRequestTimeoutResponse(scala.Function1<HttpRequest,HttpResponse> handler)
      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:
      handler - (undocumented)
      Returns:
      (undocumented)