Class DefaultLoadBalancer
-
- All Implemented Interfaces:
-
dev.arbjerg.lavalink.client.loadbalancing.ILoadBalancer
public final class DefaultLoadBalancer implements ILoadBalancer
-
-
Constructor Summary
Constructors Constructor Description DefaultLoadBalancer(LavalinkClient client)
-
Method Summary
Modifier and Type Method Description Unit
addPenaltyProvider(IPenaltyProvider penaltyProvider)
Adds a penalty provider to the load balancer. Unit
removePenaltyProvider(IPenaltyProvider penaltyProvider)
Removes a penalty provider from the load balancer. LavalinkNode
selectNode(VoiceRegion region, Long guildId)
Selects a node based on the criteria of the load balancer. -
-
Constructor Detail
-
DefaultLoadBalancer
DefaultLoadBalancer(LavalinkClient client)
-
-
Method Detail
-
addPenaltyProvider
Unit addPenaltyProvider(IPenaltyProvider penaltyProvider)
Adds a penalty provider to the load balancer.
-
removePenaltyProvider
Unit removePenaltyProvider(IPenaltyProvider penaltyProvider)
Removes a penalty provider from the load balancer.
-
selectNode
LavalinkNode selectNode(VoiceRegion region, Long guildId)
Selects a node based on the criteria of the load balancer.
- Parameters:
region
- A voice region may be provided to filter on the closest region to this nodeguildId
- The ID of the guild to be associated with the returned node- Returns:
The best node that matches the criteria
-
-
-
-