RateLimiterAlgorithm

ox.resilience.RateLimiterAlgorithm

Determines the algorithm to use for the rate limiter

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes

Members list

Value members

Abstract methods

def acquire(permits: Int): Unit

Acquires permits to execute the operation. This method should block until a permit is available.

Acquires permits to execute the operation. This method should block until a permit is available.

Attributes

def getNextUpdate: Long

Returns the time in nanoseconds that needs to elapse until the next update. It should not modify internal state.

Returns the time in nanoseconds that needs to elapse until the next update. It should not modify internal state.

Attributes

def runOperation[T](operation: => T, permits: Int): T

Runs the operation, allowing the algorithm to take into account its duration, if needed.

Runs the operation, allowing the algorithm to take into account its duration, if needed.

Attributes

def tryAcquire(permits: Int): Boolean

Tries to acquire permits to execute the operation. This method should not block.

Tries to acquire permits to execute the operation. This method should not block.

Attributes

def update(): Unit

Updates the internal state of the rate limiter to check whether new operations can be accepted.

Updates the internal state of the rate limiter to check whether new operations can be accepted.

Attributes

Concrete methods

final def acquire(): Unit

Acquires a permit to execute the operation. This method should block until a permit is available.

Acquires a permit to execute the operation. This method should block until a permit is available.

Attributes

final def runOperation[T](operation: => T): T

Runs the operation, allowing the algorithm to take into account its duration, if needed.

Runs the operation, allowing the algorithm to take into account its duration, if needed.

Attributes

final def tryAcquire(): Boolean

Tries to acquire a permit to execute the operation. This method should not block.

Tries to acquire a permit to execute the operation. This method should not block.

Attributes