retry

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2021 License: Apache-2.0 Imports: 6 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ReaderRetry

type ReaderRetry struct {
	// contains filtered or unexported fields
}

ReaderRetry is used to control the retry for the ReaderRetry. It is not thread-safe.

func NewReaderRetry

func NewReaderRetry(cfg ReaderRetryConfig) (*ReaderRetry, error)

NewReaderRetry creates a new ReaderRetry instance.

func (*ReaderRetry) Check

func (rr *ReaderRetry) Check(ctx context.Context, err error) bool

Check checks whether should retry for the error.

type ReaderRetryConfig

type ReaderRetryConfig struct {
	BackoffRollback time.Duration `toml:"backoff-rollback" json:"backoff-rollback"`
	BackoffMax      time.Duration `toml:"backoff-max" json:"backoff-max"`
	// unexpose config
	BackoffMin    time.Duration `json:"-"`
	BackoffJitter bool          `json:"-"`
	BackoffFactor float64       `json:"-"`
}

ReaderRetryConfig is the configuration used for binlog reader retry backoff. we always enable this now.

Jump to

Keyboard shortcuts

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