retry

package
v1.30.1 Latest Latest
Warning

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

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

Documentation

Overview

Package retry contains a very simple arbitrary function retrier.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Retry

func Retry(
	ctx context.Context,
	jobFunc func() (interface{}, error),
	retryFunc func(error) error,
) (out interface{}, err error)

Retry retries the given jobFunc until the context cancels. If a retry is needed and retryFunc is not nil, it will be called. retryFunc will get the error that caused the retry. If retryFunc retries an error, then the retry procedure stops, and the error is returned.

Types

This section is empty.

Jump to

Keyboard shortcuts

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