Throttex (throttex v0.1.0)
Throttex is a GenServer which provides interface for rate limit control.
Basically it provides two main functions: request and release.
Performing request, it allows or disallows operation accordingly to the Rate Limit rules. When the request has been completed, release is expected to be called to confirm operation.
Summary
Functions
Returns a specification to start this module under a supervisor.
Functions
Returns a specification to start this module under a supervisor.
See Supervisor
.
@spec release(GenServer.server(), Throttex.Types.timestamp()) :: :ok
@spec request(GenServer.server(), rate_id :: term()) :: {:ok, request_id :: term()} | {:error, :invalid_rate | :unavailable}