warmup

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2025 License: Apache-2.0 Imports: 7 Imported by: 4 modules, 3 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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