Timeout

org.http4s.server.middleware.Timeout$
object Timeout

Attributes

Source:
Timeout.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Timeout.type

Members list

Concise view

Value members

Concrete methods

def apply[F[_], G[_], A](timeout: FiniteDuration, timeoutResponse: F[Response[G]])(http: Kleisli[F, A, Response[G]])(implicit F: Temporal[F]): Kleisli[F, A, Response[G]]

Transform the service to return a timeout response after the given duration if the service has not yet responded. If the timeout fires, the service's response is canceled.

Transform the service to return a timeout response after the given duration if the service has not yet responded. If the timeout fires, the service's response is canceled.

Attributes

timeout

Finite duration to wait before returning the provided response

Note:

if the service runs uncancelable effects while responding (e.g. if service uses MonadCancel#uncancelable under the hood) and has exceeded the timeout, then the expected behavior is:

  • uncancelable effects will be completed naturally (regardless of how long it takes),
  • after that, the timeout response will be returned. To get more insights on effect cancelation, dig into the MonadCancel documentation.
Source:
Timeout.scala
def apply[F[_] : Temporal, G[_], A](timeout: FiniteDuration)(http: Kleisli[F, A, Response[G]]): Kleisli[F, A, Response[G]]

Transform the service to return a timeout response after the given duration if the service has not yet responded. If the timeout fires, the service's response is canceled.

Transform the service to return a timeout response after the given duration if the service has not yet responded. If the timeout fires, the service's response is canceled.

Attributes

timeout

Finite duration to wait before returning a 503 Service Unavailable response

Note:

if the service runs uncancelable effects while responding (e.g. if service uses MonadCancel#uncancelable under the hood) and has exceeded the timeout, then the expected behavior is:

  • uncancelable effects will be completed naturally (regardless of how long it takes),
  • after that, the timeout response will be returned. To get more insights on effect cancelation, dig into the MonadCancel documentation.
Source:
Timeout.scala
def httpApp[F[_] : Temporal](timeout: FiniteDuration)(httpApp: HttpApp[F]): HttpApp[F]

This is the same as [[applyF[_],G[_],A*]], but for HttpApp

This is the same as [[applyF[_],G[_],A*]], but for HttpApp

Attributes

Source:
Timeout.scala
def httpApp[F[_] : Temporal](timeout: FiniteDuration, timeoutResponse: F[Response[F]])(httpApp: HttpApp[F]): HttpApp[F]

This is the same as apply, but for HttpApp

This is the same as apply, but for HttpApp

Attributes

Source:
Timeout.scala
def httpRoutes[F[_] : Temporal](timeout: FiniteDuration)(httpRoutes: HttpRoutes[F]): HttpRoutes[F]

This is the same as [[applyF[_],G[_],A*]], but for HttpRoutes

This is the same as [[applyF[_],G[_],A*]], but for HttpRoutes

Attributes

Source:
Timeout.scala
def httpRoutes[F[_] : Temporal](timeout: FiniteDuration, timeoutResponse: F[Response[F]])(httpRoutes: HttpRoutes[F]): HttpRoutes[F]

This is the same as apply, but for HttpRoutes

This is the same as apply, but for HttpRoutes

Attributes

Source:
Timeout.scala