Throttle
Transform a service to reject any calls the go over a given rate.
Attributes
- Source:
- Throttle.scala
- Graph
- Supertypes
- Self type
- Throttle.type
Members list
Type members
Classlikes
Attributes
- Source:
- Throttle.scala
- Graph
- Supertypes
- Known subtypes
- object TokenAvailable.typeclass TokenUnavailable
Attributes
- Source:
- Throttle.scala
- Graph
- Supertypes
- trait Singletontrait Producttrait Mirrorclass TokenAvailabilitytrait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass Any
- Self type
- TokenAvailable.type
Attributes
- Companion:
- trait
- Source:
- Throttle.scala
- Graph
- Supertypes
- Self type
- TokenBucket.type
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.
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.
Attributes
- Companion:
- object
- Source:
- Throttle.scala
- Graph
- Supertypes
Attributes
- Source:
- Throttle.scala
- Graph
- Supertypes
- class TokenAvailabilitytrait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass Any
Value members
Concrete methods
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
Attributes
- amount
the number of calls to the service to permit within the given time period.
- http
the service to transform.
- per
the time period over which a given number of calls is permitted.
- Returns:
a task containing the transformed service.
- Source:
- Throttle.scala
Limits the supplied service using a provided TokenBucket
Limits the supplied service using a provided TokenBucket
Attributes
- bucket
a TokenBucket to use to track the rate of incoming requests.
- http
the service to transform.
- throttleResponse
a function that defines the response when throttled, may be supplied a suggested retry time depending on bucket implementation.
- Returns:
a task containing the transformed service.
- Source:
- Throttle.scala
Attributes
- Source:
- Throttle.scala
As [apply(amount,per)], but for HttpApp[F]
As [apply(bucket,throttleResponse)], but for HttpApp[F]
As [apply(amount,per)], but for HttpRoutes[F]
As [apply(bucket,throttleResponse)], but for HttpRoutes[F]