RateLimiter

ox.resilience.RateLimiter
See theRateLimiter companion object
class RateLimiter

Rate limiter with a customizable algorithm. Operations can be blocked or dropped, when the rate limit is reached. The rate limiter might take into account the start time of the operation, or its entire duration.

Attributes

Companion
object
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def runBlocking[T](operation: => T): T

Runs the operation, blocking if the rate limit is reached, until the rate limiter is replenished.

Runs the operation, blocking if the rate limit is reached, until the rate limiter is replenished.

Attributes

def runOrDrop[T](operation: => T): Option[T]

Runs the operation or drops it, if the rate limit is reached.

Runs the operation or drops it, if the rate limit is reached.

Attributes

Returns

Some if the operation has been run, None if the operation has been dropped.