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

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

release(pid \\ __MODULE__, request_id)

@spec release(GenServer.server(), Throttex.Types.timestamp()) :: :ok

request(pid \\ __MODULE__, rate_id)

@spec request(GenServer.server(), rate_id :: term()) ::
  {:ok, request_id :: term()} | {:error, :invalid_rate | :unavailable}

start(args)

start_link(args)