Package discord4j.core
Class GatewayResources
- java.lang.Object
-
- discord4j.core.GatewayResources
-
public class GatewayResources extends Object
A set of dependencies required to build and coordinate multipleGatewayClientinstances.
-
-
Constructor Summary
Constructors Constructor Description GatewayResources(Store store, EventDispatcher eventDispatcher, ShardCoordinator shardCoordinator, MemberRequestFilter memberRequestFilter, GatewayReactorResources gatewayReactorResources, VoiceReactorResources voiceReactorResources, ReconnectOptions voiceReconnectOptions, IntentSet intents)Create a newGatewayResourceswith the given parameters.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description EventDispatchergetEventDispatcher()Distributes events to subscribers.GatewayReactorResourcesgetGatewayReactorResources()Return theGatewayReactorResourcesused to perform Gateway-related operations.IntentSetgetIntents()MemberRequestFiltergetMemberRequestFilter()Return aMemberRequestFilterindicating whether this shard group should be requesting guild members.ShardCoordinatorgetShardCoordinator()Returns theShardCoordinatorthat is capable of coordinating certain shard actions.StoregetStore()Returns theStoreused to cache data during gateway sessions.VoiceReactorResourcesgetVoiceReactorResources()Return theVoiceReactorResourcesused to perform Voice Gateway-related operations.ReconnectOptionsgetVoiceReconnectOptions()Return the reconnect policy used to retry a connection to the Voice Gateway.
-
-
-
Constructor Detail
-
GatewayResources
public GatewayResources(Store store, EventDispatcher eventDispatcher, ShardCoordinator shardCoordinator, MemberRequestFilter memberRequestFilter, GatewayReactorResources gatewayReactorResources, VoiceReactorResources voiceReactorResources, ReconnectOptions voiceReconnectOptions, IntentSet intents)
Create a newGatewayResourceswith the given parameters.- Parameters:
store- an entity cacheeventDispatcher- an event bus dedicated to distributeEventinstancesshardCoordinator- 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 Detail
-
getIntents
public IntentSet getIntents()
- Returns:
- The
IntentSettied to thisGatewayResources
-
getStore
public Store getStore()
Returns theStoreused to cache data during gateway sessions.- Returns:
- the
Storeinstance
-
getEventDispatcher
public EventDispatcher getEventDispatcher()
Distributes events to subscribers. Starting from v3.1, theEventDispatcheris capable of distributing events from allGatewayClientconnections (shards) that were specified when thisGatewayDiscordClientwas created.- Returns:
- the
EventDispatchertied to thisGatewayResources
-
getShardCoordinator
public ShardCoordinator getShardCoordinator()
Returns theShardCoordinatorthat is capable of coordinating certain shard actions.- Returns:
- the
ShardCoordinatortied to thisGatewayResources
-
getMemberRequestFilter
public MemberRequestFilter getMemberRequestFilter()
Return aMemberRequestFilterindicating whether this shard group should be requesting guild members.- Returns:
- the
MemberRequestFilterconfigured in thisGatewayResources
-
getGatewayReactorResources
public GatewayReactorResources getGatewayReactorResources()
Return theGatewayReactorResourcesused to perform Gateway-related operations.- Returns:
- the Gateway Reactor resources
-
getVoiceReactorResources
public VoiceReactorResources getVoiceReactorResources()
Return theVoiceReactorResourcesused to perform Voice Gateway-related operations.- Returns:
- the Voice Gateway Reactor resources
-
getVoiceReconnectOptions
public ReconnectOptions getVoiceReconnectOptions()
Return the reconnect policy used to retry a connection to the Voice Gateway.- Returns:
- a reconnection policy
-
-