Documentation ¶
Overview ¶
Implements round robin load balancing algorithm.
* As long as vulcan does not have static endpoints configurations most of the time, it keeps track of the endpoints that were used recently and keeps cursor for these endpoints for a while.
* Unused cursors are being expired and removed from the map if they have not been used for 60 seconds.
* If the load balancer can find matching cursor for the given endpoints, algo simply advances to the next one, taking into consideration endpoint availability.
Index ¶
Constants ¶
View Source
const ExpirySeconds = 60
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RoundRobin ¶
type RoundRobin struct {
// contains filtered or unexported fields
}
func NewRoundRobin ¶
func NewRoundRobin(timeProvider timeutils.TimeProvider) *RoundRobin
func (*RoundRobin) NextEndpoint ¶
func (r *RoundRobin) NextEndpoint(endpoints []loadbalance.Endpoint) (loadbalance.Endpoint, error)
Click to show internal directories.
Click to hide internal directories.