WebsockexNova.Behaviors.RateLimitHandler behaviour (WebsockexNova v0.1.0)
View SourceBehaviour for rate limit handlers. All state is a map. All arguments and return values are explicit and documented.
Summary
Callbacks
Check if a request can proceed based on current rate limits. Returns
Process queued requests on a periodic tick. Returns
Initialize the rate limit handler's state.
Types
Callbacks
@callback check_rate_limit(request(), state()) :: {:allow, state()} | {:queue, state()} | {:reject, term(), state()}
Check if a request can proceed based on current rate limits. Returns:
{:allow, state}
{:queue, state}
{:reject, reason, state}
Process queued requests on a periodic tick. Returns:
{:ok, state}
{:process, request, state}
Initialize the rate limit handler's state.