Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Results ¶
type Results struct {
// Success is true if there were no errors, or if all failed attempts
// succeeded on within maxErrs subsequent attempts.
Success bool
// Overruns counts the total number of overruns.
Overruns int
// Errs counts total number of errors, some may have been retried.
Errs int
}
Results describe the results of running a loop.
func Run ¶
func Run(ctx context.Context, f Runner, cycle time.Duration, maxErrs int, c clock.Clock) (ret *Results)
Run will run f every cyle (at least once), and fail if maxErrs are returned by f in a row. It returns Results indiciating success, number of overruns and errors. Use context.WithCancel/Timeout/Deadline to limit the overall run time.
Click to show internal directories.
Click to hide internal directories.