core: Index | Files

package retry

import ""


Package Files

errors.generated.go retry.go


var (
    ErrRetryFailed = newError("all retry attempts failed")

type Strategy Uses

type Strategy interface {
    // On performs a retry on a specific function, until it doesn't return any error.
    On(func() error) error

Strategy is a way to retry on a specific function.

func ExponentialBackoff Uses

func ExponentialBackoff(attempts int, delay uint32) Strategy

func Timed Uses

func Timed(attempts int, delay uint32) Strategy

Timed returns a retry strategy with fixed interval.

Package retry imports 2 packages (graph) and is imported by 99 packages. Updated 2020-10-15. Refresh now. Tools for package owners.