Rate limit information parsed from Column API response headers.
Column includes rate limit headers on API responses. This struct captures that information for observability and backoff decisions.
Headers parsed
x-ratelimit-limit— Maximum requests allowed in the windowx-ratelimit-remaining— Remaining requests in current windowx-ratelimit-reset— Unix timestamp when the window resetsretry-after— Seconds to wait before retrying (on 429 responses)
Usage
case Column.ACH.create(%{...}) do
{:ok, result} -> result
{:error, %Column.Error{status: 429, raw: raw}} ->
info = Column.RateLimit.from_error_raw(raw)
Process.sleep(info.retry_after_ms || 1_000)
# retry...
end
Summary
Functions
Returns true if the rate limit window is exhausted.
Build from error raw body (when you only have the error struct).
Parse rate limit info from Req-style response headers (a map of lists).
Milliseconds to wait before the rate limit window resets.
Types
@type t() :: %Column.RateLimit{ limit: non_neg_integer() | nil, remaining: non_neg_integer() | nil, reset_at: DateTime.t() | nil, retry_after_ms: non_neg_integer() | nil }
Functions
Returns true if the rate limit window is exhausted.
Build from error raw body (when you only have the error struct).
Parse rate limit info from Req-style response headers (a map of lists).
@spec ms_until_reset(t()) :: non_neg_integer() | nil
Milliseconds to wait before the rate limit window resets.