Resiliency patterns for golang
Breaker.GetState()
to check the breaker state directly (e.g. for monitoring metrics).Batcher.Shutdown()
to behave correctly when multiple batches end up executing at once.Retrier.WithInfiniteRetry()
and Retrier.RunFn()
to handle more complex cases (thanks to Maxime Beckman).Batcher.Shutdown()
to flush any pending work without waiting for the timer, e.g. on application shutdown (thanks to Ivan Stankov).Deadline.Run()
on ErrTimeOut
.go.mod
file to conform to more recent Golang version standards.errors.Is
when classifying errors for the Retrier
(thanks to Taufik Rama).LimitedExponentialBackoff
for the Retrier
(thanks to tukeJonny).Note: This release requires Golang at least 1.7, which is higher than the previous release. All the versions being dropped are multiple years old and no longer supported upstream, so I'm not counting this as a breaking change.
RunCtx
method on Retrier
to support running with a context.Retrier
's use of random numbers is concurrency-safe.IsEmpty()
method on Semaphore
.