limiter v0.1.2 Limiter.Result

The struct is the result of calling Limiter.checkout/5 function.

Summary

Types

Indicates if an action is allowed or rate limited

The number of actions that is allowed before reaching the rate limit

How long (in milliseconds) it will take for the given key to get to the initial state

How long (in milliseconds) it will take for the next action (associated with the given key) to be allowed

t()

The result map

Types

allowed()
allowed() :: boolean

Indicates if an action is allowed or rate limited.

remaining()
remaining() :: non_neg_integer

The number of actions that is allowed before reaching the rate limit.

reset_after()
reset_after() :: non_neg_integer

How long (in milliseconds) it will take for the given key to get to the initial state.

retry_after()
retry_after() :: non_neg_integer

How long (in milliseconds) it will take for the next action (associated with the given key) to be allowed.

t()
t() :: %Limiter.Result{allowed: allowed, remaining: remaining, reset_after: reset_after, retry_after: retry_after}

The result map.