Client-side token-bucket rate limiter implemented as an OTP GenServer.
Each unique {client_id, environment} pair gets an independent bucket.
Limits come from SetuClient.Config fields :rate_limit_rps and :rate_limit_burst.
Summary
Functions
Acquires one token for cfg, blocking if the bucket is empty.
Returns a specification to start this module under a supervisor.
Types
Functions
@spec acquire(SetuClient.Config.t()) :: :ok | {:error, :timeout}
Acquires one token for cfg, blocking if the bucket is empty.
Returns :ok when a token is granted, {:error, :timeout} after cfg.timeout ms.
Returns a specification to start this module under a supervisor.
See Supervisor.