tukeJonny a141741259 Revert "Add build flag for retrier implements" преди 6 години
..
README.md ed0319b32e Add code-of-conduct badge to READMEs преди 10 години
backoffs.go a5cb3f2b7d Implement the retriable resiliency pattern преди 11 години
backoffs_test.go a5cb3f2b7d Implement the retriable resiliency pattern преди 11 години
classifier.go a5cb3f2b7d Implement the retriable resiliency pattern преди 11 години
classifier_test.go a5cb3f2b7d Implement the retriable resiliency pattern преди 11 години
retrier.go a141741259 Revert "Add build flag for retrier implements" преди 6 години
retrier_go17_test.go 176a8e6f82 Add test for retrier.RunCtx преди 6 години
retrier_test.go 2c68be121c Protect rand prng with a mutex. Add test against regressions. преди 7 години

README.md

retrier

Build Status GoDoc Code of Conduct

The retriable resiliency pattern for golang.

Creating a retrier takes two parameters:

  • the times to back-off between retries (and implicitly the number of times to retry)
  • the classifier that determines which errors to retry
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
}