Modifier and Type | Class and Description |
---|---|
static class |
TokenRateLimit.RateLimitType
Type of rate limit to know what headers to check.
|
Modifier and Type | Field and Description |
---|---|
static String |
HEADER_RETRY_AFTER
Header specifying retry after time in seconds after a 429.
|
static String |
HEADER_X_RATE_LIMIT_TYPE
Header specifying which RateLimitType caused a 429.
|
Constructor and Description |
---|
TokenRateLimit(TokenRateLimit.RateLimitType type,
RiotApiConfig config) |
Modifier and Type | Method and Description |
---|---|
List<TemporalBucket> |
getBuckets()
Get the rate limit's buckets.
|
void |
onResponse(org.asynchttpclient.Response response)
Callback for when a response returns.
|
long |
retryAfterDelay()
Get delay needed to respect retry-after headers.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getOrDelay
public static final String HEADER_X_RATE_LIMIT_TYPE
public static final String HEADER_RETRY_AFTER
public TokenRateLimit(TokenRateLimit.RateLimitType type, RiotApiConfig config)
public long retryAfterDelay()
RateLimit
retryAfterDelay
in interface RateLimit
public List<TemporalBucket> getBuckets()
RateLimit
getBuckets
in interface RateLimit
public void onResponse(org.asynchttpclient.Response response)
RateLimit
onResponse
in interface RateLimit
response
- Response that applies to this RateLimit.Copyright © 2019. All rights reserved.