addedeffect: go.aporeto.io/addedeffect/retry Index | Files

package retry

import "go.aporeto.io/addedeffect/retry"

Package retry contains a very simple arbitrary function retrier.

Index

Package Files

doc.go retry.go

func Retry Uses

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.

Package retry imports 2 packages (graph) and is imported by 2 packages. Updated 2019-05-01. Refresh now. Tools for package owners.