ETS-backed store for rate limit status across exchanges.
Stores the latest CCXT.RateLimiter.Info from each exchange response, keyed by
{exchange_id, api_key | :public}. This allows consumers to query current
rate limit pressure at any time.
Architecture
A GenServer owns the ETS table (OTP-idiomatic -- handles restarts cleanly).
The table is :public with read_concurrency: true so any process can
read without going through the GenServer.
Usage
case CCXT.RateLimiter.State.status("binance") do
%Info{remaining: remaining} -> remaining
nil -> :unknown
end
Summary
Functions
Returns all rate limit entries for an exchange.
Returns a specification to start this module under a supervisor.
Starts the State GenServer.
Returns the latest rate limit info for an exchange's public endpoints.
Returns the latest rate limit info for a specific exchange + credential key.
Updates the rate limit info for a given key.
Functions
@spec all(String.t()) :: [CCXT.RateLimiter.Info.t()]
Returns all rate limit entries for an exchange.
Returns a specification to start this module under a supervisor.
See Supervisor.
@spec start_link(keyword()) :: GenServer.on_start()
Starts the State GenServer.
@spec status(String.t()) :: CCXT.RateLimiter.Info.t() | nil
Returns the latest rate limit info for an exchange's public endpoints.
@spec status(String.t(), term()) :: CCXT.RateLimiter.Info.t() | nil
Returns the latest rate limit info for a specific exchange + credential key.
@spec update( {String.t(), term()}, CCXT.RateLimiter.Info.t() ) :: :ok
Updates the rate limit info for a given key.
Key is {exchange_id, api_key | :public}.