retry

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2019 License: Apache-2.0 Imports: 6 Imported by: 12

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(cfg Config) goresilience.Runner

New returns a new retry ready executor, the execution will be retried the number of times specificed on the config (+1, the original execution that is not a retry).

func NewMiddleware

func NewMiddleware(cfg Config) goresilience.Middleware

NewMiddleware returns a new retry middleware, the execution will be retried the number of times specificed on the config (+1, the original execution that is not a retry).

Types

type Config

type Config struct {
	// WaitBase is the base unit duration to wait on the retries.
	WaitBase time.Duration
	// Backoff enables exponential backoff on the retry (also disables jitter).
	DisableBackoff bool
	// Times is the number of times that will be retried in case of error
	// before returning the error itself.
	Times int
}

Config is the configuration used for the retry Runner.

Jump to

Keyboard shortcuts

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