DurationRateLimiterAlgorithm

ox.resilience.DurationRateLimiterAlgorithm

Algorithms, which take into account the entire duration of the operation.

There is no leakyBucket algorithm implemented, which is present in StartTimeRateLimiterAlgorithm, because effectively it would result in "max number of operations currently running", which can be achieved with single semaphore.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Type members

Classlikes

case class FixedWindow(rate: Int, per: FiniteDuration) extends RateLimiterAlgorithm

Fixed window algorithm: allows running at most rate operations in consecutively segments of duration per. Considers whole execution time of an operation. Operation spanning more than one window blocks permits in all windows that it spans.

Fixed window algorithm: allows running at most rate operations in consecutively segments of duration per. Considers whole execution time of an operation. Operation spanning more than one window blocks permits in all windows that it spans.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
case class SlidingWindow(rate: Int, per: FiniteDuration) extends RateLimiterAlgorithm

Sliding window algorithm: allows to run at most rate operations in the lapse of per before current time. Considers whole execution time of an operation. Operation release permit after per passed since operation ended.

Sliding window algorithm: allows to run at most rate operations in the lapse of per before current time. Considers whole execution time of an operation. Operation release permit after per passed since operation ended.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all