retry

package
v0.11.0-dev.0 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2023 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Try added in v0.7.1

func Try(ctx context.Context, f func() error, attempts int, delay time.Duration) (err error)

Try runs the f function until it returns nil but not more than defined in the attempts argument. After reaching the max attempts, it returns the last error. The delay argument defines the time between each attempt. If the context is canceled, the function stops and returns the error.

func TryForever added in v0.7.1

func TryForever(ctx context.Context, f func() error, delay time.Duration)

TryForever runs the f function until it returns nil or the context is canceled. The delay argument defines the time between each attempt.

Types

This section is empty.

Jump to

Keyboard shortcuts

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