package balancer

import "github.com/ydb-platform/ydb-go-sdk/v3/internal/balancer"

Index

Functions

func IsOkConnection

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.

Source Files

balancer.go

Directories

PathSynopsis
internal/balancer/ctxbalancer
internal/balancer/list
internal/balancer/mock
internal/balancer/multi
internal/balancer/rr
internal/balancer/single
Version
v3.24.1-rc0
Published
Apr 25, 2022
Platform
darwin/amd64
Imports
2 packages
Last checked
2 minutes ago

Tools for package owners.