HttpClient.RateLimiter (http_client v0.2.4)

Module used to rate limit calls to certain host

In config.exs :

config :http_client, :rate_limits, "google.com": [{:timer.seconds(1), 5}, {:timer.hours(24), 500_000}]

Link to this section Summary

Functions

Function that needs to be called before using the rate limiter It should be ran by a long running process, if the procees gets killed, the ETS table is also killed

Link to this section Types

Specs

record() :: {term(), non_neg_integer(), non_neg_integer()}

Link to this section Functions

Specs

init() :: :ok

Function that needs to be called before using the rate limiter It should be ran by a long running process, if the procees gets killed, the ETS table is also killed

Specs

nothing() :: :ok
Link to this function

rate_limit(url)

Specs

rate_limit(String.t()) :: {:ok, (() -> :ok)}
Link to this function

rate_limit(url, function)

Specs

rate_limit(String.t(), (() -> any())) :: any()