Object

org.http4s.server.middleware

Throttle

Related Doc: package middleware

Permalink

object Throttle

Transform a service to reject any calls the go over a given rate.

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Throttle
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. sealed abstract class TokenAvailability extends Product with Serializable

    Permalink
  2. trait TokenBucket[F[_]] extends AnyRef

    Permalink

    A token bucket for use with the Throttle middleware.

    A token bucket for use with the Throttle middleware. Consumers can take tokens which will be refilled over time. Implementations are required to provide their own refill mechanism.

    Possible implementations include a remote TokenBucket service to coordinate between different application instances.

  3. final case class TokenUnavailable(retryAfter: Option[FiniteDuration]) extends TokenAvailability with Product with Serializable

    Permalink

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. object TokenAvailable extends TokenAvailability with Product with Serializable

    Permalink
  5. object TokenBucket

    Permalink
  6. def apply[F[_], G[_]](bucket: TokenBucket[F], throttleResponse: (Option[FiniteDuration]) ⇒ Response[G] = defaultResponse[G])(http: Http[F, G])(implicit F: Sync[F]): Http[F, G]

    Permalink

    Limits the supplied service using a provided TokenBucket

    Limits the supplied service using a provided TokenBucket

    bucket

    a TokenBucket to use to track the rate of incoming requests.

    throttleResponse

    a function that defines the response when throttled, may be supplied a suggested retry time depending on bucket implementation.

    http

    the service to transform.

    returns

    a task containing the transformed service.

  7. def apply[F[_], G[_]](amount: Int, per: FiniteDuration)(http: Http[F, G])(implicit F: Sync[F], timer: Clock[F]): F[Http[F, G]]

    Permalink

    Limits the supplied service to a given rate of calls using an in-memory TokenBucket

    Limits the supplied service to a given rate of calls using an in-memory TokenBucket

    amount

    the number of calls to the service to permit within the given time period.

    per

    the time period over which a given number of calls is permitted.

    http

    the service to transform.

    returns

    a task containing the transformed service.

  8. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  9. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  10. def defaultResponse[F[_]](retryAfter: Option[FiniteDuration]): Response[F]

    Permalink
  11. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  12. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  13. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  14. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  15. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  16. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  17. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  18. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  19. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  20. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  21. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  22. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  23. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  24. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped