balancer

package
v3.24.1-rc0 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2022 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsOkConnection added in v3.25.0

func IsOkConnection(c conn.Conn, bannedIsOk bool) bool

Types

type Balancer

type Balancer interface {
	// Next returns next connection for request.
	// return Err
	Next(ctx context.Context, allowBanned bool) conn.Conn

	// Create makes empty balancer with same implementation
	Create(conns []conn.Conn) Balancer

	// NeedRefresh ctx used to timeout
	// is must cancel by caller for prevent goroutine leak
	// without ctx NeedRefresh can return never.
	NeedRefresh(ctx context.Context) bool
}

Balancer is an interface that implements particular load-balancing algorithm.

Balancer methods called synchronized. That is, implementations must not provide additional goroutine safety.

type Element

type Element interface{}

Element is an empty interface that holds some Balancer specific data.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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