Package net.dv8tion.jda.api.requests
Class RestRateLimiter.RateLimitConfig
java.lang.Object
net.dv8tion.jda.api.requests.RestRateLimiter.RateLimitConfig
- Enclosing interface:
- RestRateLimiter
Configuration for the rate-limiter.
-
Constructor Summary
ConstructorDescriptionRateLimitConfig
(ScheduledExecutorService scheduler, ExecutorService elastic, RestRateLimiter.GlobalRateLimit globalRateLimit, boolean isRelative) RateLimitConfig
(ScheduledExecutorService scheduler, RestRateLimiter.GlobalRateLimit globalRateLimit, boolean isRelative) -
Method Summary
Modifier and TypeMethodDescriptionThe elasticExecutorService
used to execute rate-limit tasks.The global rate-limit store.TheScheduledExecutorService
used to schedule rate-limit tasks.boolean
Whether to useRestRateLimiter.RESET_AFTER_HEADER
.
-
Constructor Details
-
RateLimitConfig
public RateLimitConfig(@Nonnull ScheduledExecutorService scheduler, @Nonnull RestRateLimiter.GlobalRateLimit globalRateLimit, boolean isRelative) -
RateLimitConfig
public RateLimitConfig(@Nonnull ScheduledExecutorService scheduler, @Nonnull ExecutorService elastic, @Nonnull RestRateLimiter.GlobalRateLimit globalRateLimit, boolean isRelative)
-
-
Method Details
-
getScheduler
TheScheduledExecutorService
used to schedule rate-limit tasks.- Returns:
- The
ScheduledExecutorService
-
getElastic
The elasticExecutorService
used to execute rate-limit tasks.
This pool can potentially scale up and down depending on use.It is also possible that this pool is identical to
getScheduler()
.- Returns:
- The elastic
ExecutorService
-
getGlobalRateLimit
The global rate-limit store.- Returns:
- The global rate-limit store
-
isRelative
public boolean isRelative()Whether to useRestRateLimiter.RESET_AFTER_HEADER
.
This is primarily to avoid NTP sync issues.- Returns:
- True, if
RestRateLimiter.RESET_AFTER_HEADER
should be used instead ofRestRateLimiter.RESET_HEADER
-