Hammer, a Rate-Limiter for Elixir
Hammer is a rate-limiter for the Elixir language. It’s killer feature is a pluggable backend system, allowing you to use whichever storage suits your needs. Currently, backends for ETS and Redis are available.
case Hammer.check_rate("file_upload:#{user_id}", 60_000, 10) do
{:allow, _count} ->
Upload.file(data)
{:deny, _limit} ->
render_error_page()
end
To get started with Hammer, read the Tutorial.
A primary goal of the Hammer project is to make it easy to implement new storage backends. See the documentation on creating backends for more details.