roundrobin

package
v0.0.0-...-e5281c0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 27, 2013 License: Apache-2.0 Imports: 7 Imported by: 0

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)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL