DiscordRateLimiterSpec
public protocol DiscordRateLimiterSpec
A DiscordRateLimiterSpec is in charge of making sure we don’t flood Discord with requests. It keeps a dictionary of DiscordRateLimitKeys and DiscordRateLimits. All requests to the REST api should be routed through a DiscordRateLimiterSpec.
-
The queue that request responses are called on.
Declaration
Swift
var callbackQueue: DispatchQueue -
Whether or not this rate limiter should immediately callback on rate limits.
Declaration
Swift
var failFast: Bool
-
Executes a request through the rate limiter.
Declaration
Swift
func executeRequest(_ request: URLRequest, for endpointKey: DiscordRateLimitKey,Parameters
requestThe request to execute.
forThe endpoint key.
callbackThe callback for this request.
-
Executes a request through the rate limiter.
Declaration
Swift
func executeRequest(endpoint: DiscordEndpoint,Parameters
endpointThe endpoint for this request.
tokenThe token to use in this request.
requestInfoA
DiscordEndpoint.EndpointRequestspecifying the request info.callbackThe callback for this request.
DiscordRateLimiterSpec Protocol Reference