Documentation ¶
Index ¶
- Variables
- type Bench
- func (b *Bench) Concurrent(c int) dataflow.Bencher
- func (b *Bench) Do() error
- func (b *Bench) Durations(d time.Duration) dataflow.Bencher
- func (b *Bench) GetReport(r *bench.Report) dataflow.Bencher
- func (b *Bench) Loop(cb func(c *dataflow.Context) error) dataflow.Bencher
- func (b *Bench) New(df *dataflow.DataFlow) interface{}
- func (b *Bench) Number(n int) dataflow.Bencher
- func (b *Bench) Rate(rate int) dataflow.Bencher
- type Retry
- func (r *Retry) Attempt(attempt int) dataflow.Retry
- func (r *Retry) Do() (err error)
- func (r *Retry) Func(cb func(c *dataflow.Context) error) dataflow.Retry
- func (r *Retry) MaxWaitTime(maxWaitTime time.Duration) dataflow.Retry
- func (r *Retry) New(df *dataflow.DataFlow) interface{}
- func (r *Retry) WaitTime(waitTime time.Duration) dataflow.Retry
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 ¶
Bench provide benchmark features
func (*Bench) Concurrent ¶
Concurrent set the number of benchmarks for concurrency
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) MaxWaitTime ¶
MaxWaitTime Sets the maximum wait time
Click to show internal directories.
Click to hide internal directories.