Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultCriteria ¶
func DefaultCriteria(tc minds.ThreadContext, attempt int, err error) bool
DefaultCriteria retries on all errors.
Types ¶
type BackoffStrategy ¶
BackoffStrategy defines how delay increases between attempts.
func DefaultBackoff ¶
func DefaultBackoff(delay time.Duration) BackoffStrategy
DefaultBackoff provides a simple constant delay.
type Criteria ¶
type Criteria func(tc minds.ThreadContext, attempt int, err error) bool
Criteria defines when a retry should be attempted.
type Option ¶
type Option func(*Options)
Option defines a retry configuration function.
func WithAttempts ¶
WithAttempts configures max retry attempts.
func WithBackoff ¶
func WithBackoff(strategy BackoffStrategy) Option
WithBackoff sets a custom backoff strategy.
func WithRetryCriteria ¶
WithRetryCriteria sets a custom retry criteria.
func WithoutTimeoutPropagation ¶
func WithoutTimeoutPropagation() Option
WithoutTimeoutPropagation disables context timeout propagation.
type Options ¶
type Options struct {
Attempts int
Backoff BackoffStrategy
ShouldRetry Criteria
PropagateTimeout bool
}
Options defines retry behavior.
func NewDefaultOptions ¶
func NewDefaultOptions() *Options
NewDefaultOptions returns default retry options.
Click to show internal directories.
Click to hide internal directories.