RateLimiterMan behaviour (Rate Limiter Man v0.2.0)

View Source

A rate limiter implementation, based heavily on a blog post by Alex Koutmous.

This package handles logic for limiting the rate at which HTTP requests are sent.

Summary

Callbacks

make_request(atom, atom, tuple, keyword)

@callback make_request(atom(), atom(), tuple(), keyword()) :: :ok

Functions

calculate_refresh_rate(otp_app, config_key)

fetch_config!(otp_app, config_key, subkey)

get_config(otp_app, config_key, subkey, default \\ nil)

get_instance_name(config_key)

Get the process name for a rate limiter instance by its config_key.

get_max_requests_per_second(otp_app, config_key)

get_rate_limiter(otp_app, config_key)

make_request(otp_app, config_key, request_handler, opts \\ [])

receive_response(unique_request_id, timeout \\ :timer.seconds(15))

Receive a response from a rate limiter.

start_rate_limiter(otp_app, config_key)

start_task_supervisor()