Skip to content

Latest commit

 

History

History
43 lines (30 loc) · 1.08 KB

README.md

File metadata and controls

43 lines (30 loc) · 1.08 KB

RateLimiting

A simple rate limiting application for demo purposes only. Previously, it only supports ETS but now it supports distributed DB with Mnensia and libcluster to handle node joining cluster. Goal is to make this configurable with different backends.

Installation

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

Tested on Elixir v1.10.1

def deps do
  [
    {:rate_limiting, "~> 0.1.5"}
  ]
end

To configure request count and duration:

config :rate_limiting,
 interval_seconds: 60,
 max_requests_count: 100

# Required config for mnesia disc mode
config :mnesia,
  dir: '.mnesia/#{Mix.env()}/#{node()}'

TODO:

Add tests!!!!

For an example, please see https://github.com/lenfree/rate_limiting/tree/master/example.

Documentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/rate_limiting.