Refactor Node Penalties into an interface that can be overriden by consumers #27
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The Penalties member of the LavaLinkNode provides a health based penalty tracker for the node. By refactoring this into an interface INodeHealthProvider we can better encapsulate its function compared to the IPenaltyProvider.
That penalties member is also not configurable for the user of the library, locking them into the default node health based loadbalancing, or overriding the default loadbalancer and having this class "dangle" still around but not doing anything except waste some cycles listening to events.
I am not married to the naming I chose here so super open to changing that + package structure. Just throwing this out there for the first pass towards unlocking some more control over the loadbalancing and controlling what players are on what nodes.
Right now the concept of nodes being either available or unavailable based soley on connection to the server is hindering the ability to correct for transient errors.
Open to discussion or feedback on the way y'all are open to solving this problem. In theory the simplest way would just be to open the
Link.transferNode
function and then let users create their own custom loadbalancer that does not pay attention to the Node Penalties tracker I am refactoring here, and keep track of all of that themselves.