filter

package
v0.2.7 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// RetryWaitTime retry basic wait time
	RetryWaitTime = 200 * time.Millisecond
	// RetryMaxWaitTime Maximum retry wait time
	RetryMaxWaitTime = 10 * time.Second
	// RetryAttempt number of retries
	RetryAttempt = 1
)
View Source
var (
	ErrRetryFail = errors.New("retry fail")
	ErrRetry     = errors.New("need to retry")
)

Functions

This section is empty.

Types

type Bench

type Bench struct {
	bench.Task
	// contains filtered or unexported fields
}

Bench provide benchmark features

func NewBench

func NewBench() *Bench

func (*Bench) Concurrent

func (b *Bench) Concurrent(c int) dataflow.Bencher

Concurrent set the number of benchmarks for concurrency

func (*Bench) Do

func (b *Bench) Do() error

Do benchmark startup function

func (*Bench) Durations

func (b *Bench) Durations(d time.Duration) dataflow.Bencher

Durations set the benchmark time

func (*Bench) GetReport

func (b *Bench) GetReport(r *bench.Report) dataflow.Bencher

func (*Bench) Loop

func (b *Bench) Loop(cb func(c *dataflow.Context) error) dataflow.Bencher

func (*Bench) New

func (b *Bench) New(df *dataflow.DataFlow) interface{}

New

func (*Bench) Number

func (b *Bench) Number(n int) dataflow.Bencher

Number set the number of benchmarks

func (*Bench) Rate

func (b *Bench) Rate(rate int) dataflow.Bencher

Rate set the frequency of the benchmark

type Retry

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

Retry is the core data structure of the retry function https://amazonaws-china.com/cn/blogs/architecture/exponential-backoff-and-jitter/

func (*Retry) Attempt

func (r *Retry) Attempt(attempt int) dataflow.Retry

Attempt set the number of retries

func (*Retry) Do

func (r *Retry) Do() (err error)

Do send function

func (*Retry) Func

func (r *Retry) Func(cb func(c *dataflow.Context) error) dataflow.Retry

func (*Retry) MaxWaitTime

func (r *Retry) MaxWaitTime(maxWaitTime time.Duration) dataflow.Retry

MaxWaitTime Sets the maximum wait time

func (*Retry) New

func (r *Retry) New(df *dataflow.DataFlow) interface{}

func (*Retry) WaitTime

func (r *Retry) WaitTime(waitTime time.Duration) dataflow.Retry

WaitTime sets the basic wait time

Jump to

Keyboard shortcuts

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