Repository navigation
feat(router): add load balancing support and unit tests - #3
gianpierofasulo wants to merge 2 commits into
Conversation
|
This PR introduces a new sub directory |
|
Thanks for the review! I have restored the original directory structure and aligned all namespaces with the project's PSR-4 configuration (
|
|
Inspired by this PR I decided to take a different approach. The RoundRobinRule is now deprecated, and I implemented a new LoadBalancingRule that equally distribute the requests against the configured providers by default, basically working as a round-robin. Then you can specify different distribuition weights: https://github.com/neuron-core/router#loadbalancingrule I also took the chance for this release to introduce a new ability in the fallback strategy to retry with a backoff time. It's available in the 1.x branch, compatible with Neuron 3.x, and it's already ported in the 2.x branch compatible with the new Neuron 4.x: https://github.com/neuron-core/router#retry-with-backoff Thank you for your contribution. |
Summary
This PR introduces load balancing capabilities to the Router module, allowing requests and tasks to be distributed across available handlers, along with a dedicated test suite.
Changes Made
src/Router/.tests/Router/to validate distribution scenarios and fallback behavior.Motivation
Adding built-in load balancing prevents bottlenecking on single handlers, improves system resilience, and ensures balanced throughput.
How Has This Been Tested?
tests/Router/.