retry

package
v0.3.0-pre10 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 9, 2019 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package retry implements exponential retry policy.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithExponentialBackoff

func WithExponentialBackoff(desc string, attempt AttemptFunc, isRetriableError IsRetriableFunc) (interface{}, error)

WithExponentialBackoff runs the provided attempt until it succeeds, retrying on all errors that are deemed retriable by the provided function. The delay between retries grows exponentially up to a certain limit.

Types

type AttemptFunc

type AttemptFunc func() (interface{}, error)

AttemptFunc performs an attempt and returns a value (optional, may be nil) and an error.

type IsRetriableFunc

type IsRetriableFunc func(err error) bool

IsRetriableFunc is a function that determines whether an error is retriable.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL