Documentation
¶
Index ¶
- func Retry(max int, timeout time.Duration, b interfaces.Balancer) endpoint.Endpoint
- func RetryAlways(timeout time.Duration, b interfaces.Balancer) endpoint.Endpoint
- func RetryWithCallback(timeout time.Duration, b interfaces.Balancer, cb RetryCallback) endpoint.Endpoint
- type RetryCallback
- type RetryError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Retry ¶
Retry returns an Endpoint that retries up to max times within timeout, selecting a new backend from b on each attempt.
func RetryAlways ¶
RetryAlways returns an Endpoint that retries indefinitely until timeout is reached or the call succeeds.
func RetryWithCallback ¶
func RetryWithCallback(timeout time.Duration, b interfaces.Balancer, cb RetryCallback) endpoint.Endpoint
Types ¶
type RetryCallback ¶
RetryCallback is called after each failed attempt. It returns whether the executor should keep trying and an optional replacement error. Returning keepTrying=false stops the retry loop immediately.
type RetryError ¶
RetryError is returned when all retry attempts are exhausted. RawErrors contains every error from each attempt; Final is the last error (or a replacement set by RetryCallback).
func (RetryError) Error ¶
func (e RetryError) Error() string
Click to show internal directories.
Click to hide internal directories.