backoff

package
v0.17.1 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2016 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Interface

type Interface interface {
	Start()
	Stop()
	SetInitialBackoff(time.Duration)
	SetMaxBackoff(time.Duration)
}

Interface does f in a loop, sleeping for initialBackoff between each iterations. If it hits an error, it exponentially backs off to maxBackoff. Backoff will log when it backs off, but will stop logging when it reaches maxBackoff. It will also log on first success.

func New

func New(f func() (bool, error), msg string) Interface

New makes a new Interface

Jump to

Keyboard shortcuts

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