Package discord4j.core
Class GatewayResources
java.lang.Object
discord4j.core.GatewayResources
A set of dependencies required to build and coordinate multiple
GatewayClient
instances.-
Constructor Summary
ConstructorDescriptionGatewayResources
(Store store, EventDispatcher eventDispatcher, ShardCoordinator shardCoordinator, MemberRequestFilter memberRequestFilter, GatewayReactorResources gatewayReactorResources, VoiceReactorResources voiceReactorResources, ReconnectOptions voiceReconnectOptions, IntentSet intents) Create a newGatewayResources
with the given parameters. -
Method Summary
Modifier and TypeMethodDescriptionDistributes events to subscribers.Return theGatewayReactorResources
used to perform Gateway-related operations.Return aMemberRequestFilter
indicating whether this shard group should be requesting guild members.Returns theShardCoordinator
that is capable of coordinating certain shard actions.getStore()
Returns theStore
used to cache data during gateway sessions.Return theVoiceReactorResources
used to perform Voice Gateway-related operations.Return the reconnect policy used to retry a connection to the Voice Gateway.
-
Constructor Details
-
GatewayResources
public GatewayResources(Store store, EventDispatcher eventDispatcher, ShardCoordinator shardCoordinator, MemberRequestFilter memberRequestFilter, GatewayReactorResources gatewayReactorResources, VoiceReactorResources voiceReactorResources, ReconnectOptions voiceReconnectOptions, IntentSet intents) Create a newGatewayResources
with the given parameters.- Parameters:
store
- an entity cacheeventDispatcher
- an event bus dedicated to distributeEvent
instancesshardCoordinator
- a middleware component to coordinate multiple shard-connecting effortsmemberRequestFilter
- a strategy to determine whether guild members should be requestedgatewayReactorResources
- a custom set of Reactor resources targeting Gateway operationsvoiceReactorResources
- a set of Reactor resources targeting Voice Gateway operationsvoiceReconnectOptions
- a reconnection policy for Voice Gateway connectionsintents
- a set of events to subscribe when connecting to the Gateway
-
-
Method Details
-
getIntents
- Returns:
- The
IntentSet
tied to thisGatewayResources
-
getStore
Returns theStore
used to cache data during gateway sessions.- Returns:
- the
Store
instance
-
getEventDispatcher
Distributes events to subscribers. Starting from v3.1, theEventDispatcher
is capable of distributing events from allGatewayClient
connections (shards) that were specified when thisGatewayDiscordClient
was created.- Returns:
- the
EventDispatcher
tied to thisGatewayResources
-
getShardCoordinator
Returns theShardCoordinator
that is capable of coordinating certain shard actions.- Returns:
- the
ShardCoordinator
tied to thisGatewayResources
-
getMemberRequestFilter
Return aMemberRequestFilter
indicating whether this shard group should be requesting guild members.- Returns:
- the
MemberRequestFilter
configured in thisGatewayResources
-
getGatewayReactorResources
Return theGatewayReactorResources
used to perform Gateway-related operations.- Returns:
- the Gateway Reactor resources
-
getVoiceReactorResources
Return theVoiceReactorResources
used to perform Voice Gateway-related operations.- Returns:
- the Voice Gateway Reactor resources
-
getVoiceReconnectOptions
Return the reconnect policy used to retry a connection to the Voice Gateway.- Returns:
- a reconnection policy
-