balancer

package
v15.9.8 Latest Latest
Warning

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

Go to latest
Published: May 10, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultRemoveDelay is the minimum time between successive address removals.
	DefaultRemoveDelay = 1 * time.Minute
)
View Source
const Scheme = "gitaly-ruby"

Scheme is the name of the address scheme that makes gRPC select this resolver.

Variables

This section is empty.

Functions

func AddAddress

func AddAddress(a string)

AddAddress adds the address of a gitaly-ruby instance to the load balancer.

func ConfigureBuilder

func ConfigureBuilder(numAddrs int, removeDelay time.Duration, now NowFunc)

ConfigureBuilder changes the configuration of the global balancer instance. All calls that interact with the balancer will block until ConfigureBuilder has been called at least once.

func RemoveAddress

func RemoveAddress(addr string) bool

RemoveAddress removes the address of a gitaly-ruby instance from the load balancer. Returns false if the pool is too small to remove the address.

Types

type NowFunc

type NowFunc func() time.Time

NowFunc returns the current time.

Jump to

Keyboard shortcuts

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