crux_rest v0.1.3 Crux.Rest.Handler.Global View Source
Handles global rate limits and the average time offset to discord.
All functions in Crux.Rest
automatically use this module, you do not need to worry about it.
Link to this section Summary
Functions
Adds an offset to the list of offsets
Returns a specification to start this module under a supervisor
Fetches how long to wait until the global rate limit is over.
Is not positive when not rate limited
Fetches the average out of the last ten offsets to discord servers in milliseconds
Sets the global wait time if rate limited globally
Starts the global rate limite handler
Link to this section Functions
Adds an offset to the list of offsets.
Returns a specification to start this module under a supervisor.
See Supervisor
.
Fetches how long to wait until the global rate limit is over.
Is not positive when not rate limited.
Fetches the average out of the last ten offsets to discord servers in milliseconds.
set_global_wait(retry_after :: pos_integer()) :: :ok
Sets the global wait time if rate limited globally.
start_link(route :: String.t()) :: GenServer.on_start()
Starts the global rate limite handler.