View Source Nex.RateLimiter (Nex v0.1.0-beta.1)

Rate limiter module.

Link to this section Summary

Types

A limit is a tuple containing the scale period (ms) and the limit.

Functions

Iterates over the given list of limits and checks each against the specified action ID.

Link to this section Types

@type limit() :: {scale :: integer(), limit :: integer()}

A limit is a tuple containing the scale period (ms) and the limit.

Link to this section Functions

@spec limit(String.t(), [limit()]) :: :ok | {:deny, limit()} | {:error, term()}

Iterates over the given list of limits and checks each against the specified action ID.