RiotNet
8.0.0
A C#/.NET client for the Riot Games API.
|
Handles proactive rate limiting. You should only ever create one instance of this interface. More...
Public Member Functions | |
void | TrySetRules (IEnumerable< RateLimitRule > rules, string platformId, IEnumerable< RateLimitRule > currentCounts=null) |
Adds application-level rate limiting rules if they have not been added already. More... | |
void | TrySetRules (IEnumerable< RateLimitRule > rules, string methodName, string platformId, IEnumerable< RateLimitRule > currentCounts=null) |
Adds method-level rate limiting rules if they have not been added already. More... | |
DateTime | AddRequestOrGetDelay (string methodName, string platformId) |
Increments the request count, or if the rate limit is reached, gets the time (in UTC) until which the client should wait before sending a request. More... | |
Properties | |
bool | HasRules [get] |
Gets whether the rate limiter has any application-level rules set. More... | |
Handles proactive rate limiting. You should only ever create one instance of this interface.
DateTime RiotNet.IRateLimiter.AddRequestOrGetDelay | ( | string | methodName, |
string | platformId | ||
) |
Increments the request count, or if the rate limit is reached, gets the time (in UTC) until which the client should wait before sending a request.
methodName | The name of the method that is executing. |
platformId | The platform ID of the default server to connect to. This should equal one of the Models.PlatformId values. |
Implementations of this function must be thread-safe.
Implemented in RiotNet.RateLimiter.
void RiotNet.IRateLimiter.TrySetRules | ( | IEnumerable< RateLimitRule > | rules, |
string | platformId, | ||
IEnumerable< RateLimitRule > | currentCounts = null |
||
) |
Adds application-level rate limiting rules if they have not been added already.
rules | The list of rules. |
platformId | The platform ID of the response that contained the rate limit definitions. The request count will automatically be incremented for this platform. |
currentCounts | The current request counts for each rule. If unspecified, 1 request for each rule will be assumed. |
Implemented in RiotNet.RateLimiter.
void RiotNet.IRateLimiter.TrySetRules | ( | IEnumerable< RateLimitRule > | rules, |
string | methodName, | ||
string | platformId, | ||
IEnumerable< RateLimitRule > | currentCounts = null |
||
) |
Adds method-level rate limiting rules if they have not been added already.
rules | The list of rules. |
methodName | The name of the method that is executing. |
platformId | The platform ID of the response that contained the rate limit definitions. The request count will automatically be incremented for this platform. |
currentCounts | The current request counts for each rule. If unspecified, 1 request for each rule will be assumed. |
Implemented in RiotNet.RateLimiter.
|
get |
Gets whether the rate limiter has any application-level rules set.