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 ¶
var DefaultPollIntervals = []time.Duration{ time.Millisecond, 2 * time.Millisecond, 2 * time.Millisecond, 5 * time.Millisecond, 10 * time.Millisecond, 20 * time.Millisecond, 50 * time.Millisecond, 50 * time.Millisecond, 100 * time.Millisecond, 100 * time.Millisecond, 200 * time.Millisecond, 500 * time.Millisecond, time.Second, 2 * time.Second, 5 * time.Second, 10 * time.Second, 20 * time.Second, 30 * time.Second, time.Minute, }
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 ¶
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.