tower
tower copied to clipboard
Question: Looking for a service like Balance but not random
My understanding is Balance updates the set of nodes by changes from Discovery and send requests so the load is balanced among the nodes.
What I am looking for is something like this but prioritize one node and other can be balanced.
Why I need is for Raft algorithm. In Raft, any client interaction is firstly sent to the leader node in the cluster but falls back to others node in case of leader failure.
Is there already Service like this? If not, can I implement this Service by combining existing parts?
I would imagine you can create a simple service (layer?) that has two handles to two subservices...one that you want to use by default and a Balance<T> service. Then when your new service gets a request, if the inner default service is ready() you send the request to that, otherwise you send to the inner Balance<T> service?