All Projects → ExHammer → Hammer

ExHammer / Hammer

Licence: mit
An Elixir rate-limiter with pluggable backends

Programming Languages

elixir
2628 projects

Projects that are alternatives of or similar to Hammer

Ex rated
ExRated, the Elixir OTP GenServer with the naughty name that allows you to rate-limit calls to any service that requires it.
Stars: ✭ 328 (-10.38%)
Mutual labels:  phoenix, rate-limiting
Cercle
Cercle is a CRM+Project Manager for your organization - Phoenix Framework & Vuejs
Stars: ✭ 284 (-22.4%)
Mutual labels:  phoenix, phoenix-framework
adaptive throttler
manages multiple throttlers with ability to ramp up and down
Stars: ✭ 31 (-91.53%)
Mutual labels:  rate-limiting, rate-limiter
rush
rush.readthedocs.io/en/latest/
Stars: ✭ 42 (-88.52%)
Mutual labels:  rate-limiting, rate-limiter
Papercups
Open-source live customer chat
Stars: ✭ 4,554 (+1144.26%)
Mutual labels:  phoenix, phoenix-framework
poker ex
Texas Hold 'Em app written in Elixir with Phoenix and OTP
Stars: ✭ 58 (-84.15%)
Mutual labels:  phoenix, phoenix-framework
limitrr-php
Better PHP rate limiting using Redis.
Stars: ✭ 19 (-94.81%)
Mutual labels:  rate-limiting, rate-limiter
live dj
💿 Join or create video playlists to share a real-time experience with others! 🎧
Stars: ✭ 19 (-94.81%)
Mutual labels:  phoenix, phoenix-framework
curious messenger
Companion repository for Phoenix LiveView Messenger app by Curiosum.dev. Part 1: https://curiosum.dev/blog/elixir-phoenix-liveview-messenger-part-1?utm_source=github&utm_medium=social, Part 2: https://curiosum.dev/blog/elixir-phoenix-liveview-messenger-part-2?utm_source=github&utm_medium=social, Part 3: https://curiosum.dev/blog/elixir-phoenix-l…
Stars: ✭ 30 (-91.8%)
Mutual labels:  phoenix, phoenix-framework
pryin
PryIn is an Application Performance Monitoring platform for your Elixir/Phoenix application.
Stars: ✭ 25 (-93.17%)
Mutual labels:  phoenix, phoenix-framework
phoenix-liveview-15m.twitter
Based on the "real-time Twitter clone in 15 minutes with LiveView and Phoenix", from Chris McCord
Stars: ✭ 40 (-89.07%)
Mutual labels:  phoenix, phoenix-framework
phoenix bakery
Better compression for your Phoenix assets
Stars: ✭ 25 (-93.17%)
Mutual labels:  phoenix, phoenix-framework
phalcon-throttler
Phalcon Throttler is a Rate Limiter for the PHP Phalcon Framework.
Stars: ✭ 19 (-94.81%)
Mutual labels:  rate-limiting, rate-limiter
king of tokyo
👑 King of Tokyo Multiplayer Board Game using Phoenix LiveView
Stars: ✭ 25 (-93.17%)
Mutual labels:  phoenix, phoenix-framework
gringotts payment
Demo Phoenix app showing gringotts payment library integrations.
Stars: ✭ 24 (-93.44%)
Mutual labels:  phoenix, phoenix-framework
phoenix bootstrap form
Bootstrap 4 Forms for Phoenix/Elixir Applications
Stars: ✭ 38 (-89.62%)
Mutual labels:  phoenix, phoenix-framework
zero-to-graphql-using-elixir
The purpose of this example is to provide details as to how one would go about using GraphQL with the Elixir Language.
Stars: ✭ 20 (-94.54%)
Mutual labels:  phoenix, phoenix-framework
gentle-force
Brute-force, error and request rate limiting
Stars: ✭ 45 (-87.7%)
Mutual labels:  rate-limiting, rate-limiter
elixir jobs
A job board to publish and find Elixir offers.
Stars: ✭ 83 (-77.32%)
Mutual labels:  phoenix, phoenix-framework
game of life-elixir
An implementation of Conway's Game of Life in Elixir
Stars: ✭ 22 (-93.99%)
Mutual labels:  phoenix, phoenix-framework

hammer

Hammer

A rate-limiter for Elixir, with pluggable storage backends.

Build Status

Coverage Status

New! Hammer-Plug

We've just released a new helper-library to make adding rate-limiting to your Phoenix (or other plug-based) application even easier: Hammer.Plug.

Installation

Hammer is available in Hex, the package can be installed by adding hammer to your list of dependencies in mix.exs:

def deps do
  [{:hammer, "~> 6.0"}]
end

Documentation

On hexdocs: https://hexdocs.pm/hammer/frontpage.html

The Tutorial is an especially good place to start.

Usage

Example:

defmodule MyApp.VideoUpload do

  def upload(video_data, user_id) do
    case Hammer.check_rate("upload_video:#{user_id}", 60_000, 5) do
      {:allow, _count} ->
        # upload the video, somehow
      {:deny, _limit} ->
        # deny the request
    end
  end

end

The Hammer module provides the following functions:

  • check_rate(id, scale_ms, limit)
  • check_rate_inc(id, scale_ms, limit, increment)
  • inspect_bucket(id, scale_ms, limit)
  • delete_buckets(id)

Backends are configured via Mix.Config:

config :hammer,
  backend: {Hammer.Backend.ETS, [expiry_ms: 60_000 * 60 * 4,
                                 cleanup_interval_ms: 60_000 * 10]}

See the Tutorial for more.

See the Hammer Testbed app for an example of using Hammer in a Phoenix application.

Available Backends

Getting Help

If you're having trouble, either open an issue on this repo, or reach out to the maintainers (@shanekilkelly) on Twitter.

Acknowledgements

Hammer was inspired by the ExRated library, by grempe.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].