Package discord4j.rest.request
Components to build and route requests to the Discord REST API.
-
Interface Summary Interface Description GlobalRateLimiter Used to prevent requests from being sent while the bot is globally rate limited.RateLimitStrategy A mapper between aHttpClientResponse
and aDuration
representing a delay due to rate limiting.RequestQueue<T> Abstraction for a REST request queue.RequestQueueFactory Factory to createRequestQueue
instances.Router Represents a connector executingDiscordWebRequest
objects against the Discord REST API. -
Class Summary Class Description BucketGlobalRateLimiter An implementation ofGlobalRateLimiter
that uses aRateLimitOperator
coordinate requests, injecting an additional delay if a source trips the limiter early throughBucketGlobalRateLimiter.rateLimitFor(Duration)
.BucketKey Used to access the appropriateRequestStream
according to the bucket that requests for the stream fall into.DefaultRouter Facilitates the routing ofDiscordWebRequest
instances to the properRequestStream
according to the bucket in which the request falls.DiscordWebRequest Template encoding all of the needed information to make an HTTP request to Discord.DiscordWebResponse Contract to handle aMono
ofClientResponse
after a network exchange is done.RateLimitRetryOperator The retry function used for reading and completing HTTP requests.ResponseHeaderStrategy RouteMatcher A predicate that can match a givenDiscordWebRequest
.RouterOptions Options used to control the behavior of aRouter
. -
Exception Summary Exception Description DiscardedRequestException Thrown when a REST request is discarded because of a queue overflow.