Shared backoff windows keyed by arbitrary identifiers.
Summary
Functions
Clear any active backoff window.
Return the default registry (anonymous ETS table).
Get or create a limiter for the given key in the default registry.
Get or create a limiter for the given key in the provided registry.
Create a new registry. Use name: :my_table for a named ETS table.
Set a backoff window in milliseconds.
Determine whether a limiter is currently in a backoff window.
Block until the backoff window has passed.
Types
@type limiter() :: :atomics.atomics_ref()
Functions
@spec clear(limiter()) :: :ok
Clear any active backoff window.
@spec default_registry() :: registry()
Return the default registry (anonymous ETS table).
Get or create a limiter for the given key in the default registry.
Get or create a limiter for the given key in the provided registry.
Create a new registry. Use name: :my_table for a named ETS table.
@spec set(limiter(), non_neg_integer(), keyword()) :: :ok
Set a backoff window in milliseconds.
Determine whether a limiter is currently in a backoff window.
Block until the backoff window has passed.