Documentation
¶
Overview ¶
Package retry provides the most advanced interruptible mechanism to perform actions repetitively until successful.
Index ¶
- Variables
- func At(t time.Duration, fn func(i int))
- func Do(breaker strategy.Breaker, action func() error, ...) error
- func DoAsync(breaker strategy.Breaker, action func() error, ...) error
- func Retry(num int, fn func(i int)) (err error)
- func Ticker(fn func(i int) time.Duration)
- type Action
- type How
- type IRetry
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Err = xerror.NewXErr("Retry") ErrRetry = Err.New("retry error") )
Functions ¶
func Do ¶
func Do( breaker strategy.Breaker, action func() error, strategies ...func(strategy.Breaker, uint, error) bool, ) error
Do takes an action and performs it, repetitively, until successful.
Optionally, strategies may be passed that assess whether or not an attempt should be made.
func DoAsync ¶
func DoAsync( breaker strategy.Breaker, action func() error, strategies ...func(strategy.Breaker, uint, error) bool, ) error
DoAsync takes an action and performs it, repetitively, until successful.
Optionally, strategies may be passed that assess whether or not an attempt should be made.
Types ¶
type Action ¶
type Action func() error
Action defines a callable function that package retry can handle.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package backoff provides stateless methods of calculating durations based on a number of attempts made.
|
Package backoff provides stateless methods of calculating durations based on a number of attempts made. |
|
Package jitter provides methods of transforming durations.
|
Package jitter provides methods of transforming durations. |
|
Package strategy provides a way to define how retry is performed.
|
Package strategy provides a way to define how retry is performed. |
Click to show internal directories.
Click to hide internal directories.