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.

Source Files