ratekeeper alternatives and similar packages
Based on the "Miscellaneous" category.
Alternatively, view ratekeeper alternatives based on common mentions on social networks and blogs.
-
ex_rated
ExRated, the Elixir OTP GenServer with the naughty name that allows you to rate-limit calls to any service that requires it. -
countriex
All sorts of useful information about every country. A pure elixir port of the ruby Countries gem -
gen_task
Generic Task behavior that helps encapsulate errors and recover from them in classic GenStage workers.
InfluxDB - Purpose built for real-time analytics at any scale.
Do you think we are missing an alternative of ratekeeper or a related project?
Popular Comparisons
README
Ratekeeper
Ratekeeper is a library for scheduling rate-limited actions. It supports complex rate limits and estimates time left to resetting limits.
Installation
Add ratekeeper
as dependency in mix.exs
def deps do
[{:ratekeeper, "~> 0.2"}]
end
Usage
Limits can be set in config:
config :ratekeeper, :limits, %{"myapi.org" => [{1000, 5}, {60_000, 100}]}
or at runtime:
Ratekeeper.add_limit "myapi.org", 1000, 5
Ratekeeper.add_limit "myapi.org", 60_000, 100
This sets limits to 5 requests per 1 second and 100 requests per minute.
Appoint a request to rate limited api:
case Ratekeeper.register("myapi.org", 10_000) do
nil ->
raise "Rate limits exceeded, request not allowed in next 10 seconds"
delay ->
:timer.sleep(delay)
MyApi.do_request()
end
Full documentation can be found at https://hexdocs.pm/ratekeeper.