retry

package
v1.0.46 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2019 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package retry contains a simple retry mechanism defined by a slice of delay times. There are no maximum retries accounted for here. If retries should be limited, use a Timeout context to keep from retrying forever. This should probably be made into something more robust.

Index

Constants

This section is empty.

Variables

queryPollIntervals is a slice of the delays before re-checking the status on an executing query, backing off from a short delay at first. This sequence has been selected with Athena queries in mind, which may operate very quickly for things like schema manipulation, or which may run for an extended period of time, when running an actual data analysis query. Long-running queries will exhaust their rapid retries quickly, and fall back to checking every few seconds or longer.

Functions

func Retry

func Retry(ctx context.Context, retryIntervals []time.Duration, f func() (bool, error)) (err error)

Retry uses a slice of time.Duration interval delays to retry a function until it either errors or indicates that it is ready to proceed. If f returns true, or an error, the retry loop is broken. Pass a closure as f if you need to record a value from the operation that you are performing inside f.

Types

This section is empty.

Jump to

Keyboard shortcuts

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