public interface GatewayClientGroup
GatewayClient
instances.Modifier and Type | Method and Description |
---|---|
default int |
computeShardIndex(Snowflake guildId)
Return the shard index according to the shard count given by this
GatewayClientGroup . |
Optional<GatewayClient> |
find(int shardIndex)
Return a
GatewayClient given by a shardIndex , if present. |
int |
getShardCount()
Return the current value of the
shardCount parameter. |
Mono<Void> |
logout()
Instructs that on subscription this group should log out from Discord Gateway.
|
Mono<Void> |
multicast(GatewayPayload<?> payload)
Send a single
GatewayPayload to all GatewayClient instances represented by this group and
returns a Mono that signals completion when it has been sent. |
Mono<Void> |
unicast(ShardGatewayPayload<?> payload)
Send a single
ShardGatewayPayload to a specific GatewayClient instance, given by the
routing information in ShardGatewayPayload.getShardIndex() and returns a Mono that
signals completion when it has been sent. |
Optional<GatewayClient> find(int shardIndex)
GatewayClient
given by a shardIndex
, if present.shardIndex
- a shard index to locate a particular clientGatewayClient
for a shard index, if presentint getShardCount()
shardCount
parameter.Mono<Void> multicast(GatewayPayload<?> payload)
GatewayPayload
to all GatewayClient
instances represented by this group and
returns a Mono
that signals completion when it has been sent.payload
- a single outbound payloadMono
completing when the payload is sentMono<Void> unicast(ShardGatewayPayload<?> payload)
ShardGatewayPayload
to a specific GatewayClient
instance, given by the
routing information in ShardGatewayPayload.getShardIndex()
and returns a Mono
that
signals completion when it has been sent.payload
- a single outbound payloadMono
completing when the payload is sentMono<Void> logout()
default int computeShardIndex(Snowflake guildId)
GatewayClientGroup
.guildId
- the input guild ID to compute the shard index