Documentation ¶
Overview ¶
Package retry provides a generic async function executor with retries for robustness against network failures. Functions are linked to a deadline, executed asynchronously and network or context errors retried with backoff until the deadline has elapsed.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Retryer ¶
type Retryer[T any] struct { // contains filtered or unexported fields }
Retryer provides execution of functions asynchronously with retry adding robustness to network errors. The generic type T abstracts the deadline argument.
func NewForT ¶
func NewForT[T any]( _ *testing.T, ctxTimeoutFunc func(context.Context, T) (context.Context, context.CancelFunc), backoffProvider func() func() <-chan time.Time, ) (*Retryer[T], error)
NewForT returns a new Retryer instance for testing supporting a custom clock.
Click to show internal directories.
Click to hide internal directories.