Package discord4j.rest.request
Class DefaultRouter
- java.lang.Object
-
- discord4j.rest.request.DefaultRouter
-
- All Implemented Interfaces:
Router
public class DefaultRouter extends Object implements Router
Facilitates the routing ofDiscordWebRequest
instances to the properRequestStream
according to the bucket in which the request falls.
-
-
Constructor Summary
Constructors Constructor Description DefaultRouter(RouterOptions routerOptions)
Create a Discord API bucket-awareRouter
configured with the given options.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DiscordWebResponse
exchange(DiscordWebRequest request)
Queues a request for execution.
-
-
-
Constructor Detail
-
DefaultRouter
public DefaultRouter(RouterOptions routerOptions)
Create a Discord API bucket-awareRouter
configured with the given options.- Parameters:
routerOptions
- the options that configure thisRouter
-
-
Method Detail
-
exchange
public DiscordWebResponse exchange(DiscordWebRequest request)
Description copied from interface:Router
Queues a request for execution.- Specified by:
exchange
in interfaceRouter
- Parameters:
request
- the request to queue.- Returns:
- a
DiscordWebResponse
specifying a contract to operate on the response
-
-