|
|
há 6 anos atrás | |
|---|---|---|
| .. | ||
| README.md | há 10 anos atrás | |
| backoffs.go | há 11 anos atrás | |
| backoffs_test.go | há 11 anos atrás | |
| classifier.go | há 11 anos atrás | |
| classifier_test.go | há 11 anos atrás | |
| retrier.go | há 6 anos atrás | |
| retrier_test.go | há 6 anos atrás | |
The retriable resiliency pattern for golang.
Creating a retrier takes two parameters:
r := retrier.New(retrier.ConstantBackoff(3, 100*time.Millisecond), nil)
err := r.Run(func() error {
// do some work
return nil
})
if err != nil {
// handle the case where the work failed three times
}