warmup

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2024 License: Apache-2.0 Imports: 7 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientOption

type ClientOption struct {
	ErrorHandling
	ResolverOption *ResolverOption
	PoolOption     *PoolOption
}

ClientOption controls the warming up of a client.

type ErrorHandling

type ErrorHandling int

ErrorHandling controls how to handle error

const (
	IgnoreError ErrorHandling = iota
	WarningLog
	ErrorLog
	FailFast // fail if any error occurs.
)

ErrorHandling .

type Pool

type Pool interface {
	WarmUp(eh ErrorHandling, wuo *PoolOption, co remote.ConnOption) error
}

Pool is the interface for connection pools that supports warming up.

type PoolHelper

type PoolHelper struct {
	ErrorHandling
}

PoolHelper is trivial implementation to do warm-ups for connection pools.

func (*PoolHelper) WarmUp

func (p *PoolHelper) WarmUp(po *PoolOption, pool remote.ConnPool, co remote.ConnOption) (err error)

WarmUp warms up the given connection pool.

type PoolOption

type PoolOption struct {
	Targets  map[string][]string // Network => addresses; if nil, use the result of service discovery
	ConnNum  int                 // Connection numbers for each address
	Parallel int                 // If greater than zero, build connections in `Parallel` goroutines.
}

PoolOption controls the warming up of connection pools.

type ResolverOption

type ResolverOption struct {
	Dests []*rpcinfo.EndpointBasicInfo
}

ResolverOption controls the warming up of service discovery.

Jump to

Keyboard shortcuts

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