gentle

package module
v0.0.0-...-2304ba0 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2020 License: MIT Imports: 6 Imported by: 2

README

gentle

Documentation Build Status Report Card

About

Go (golang) package for generically encapsulating cancellable retry and gentle retry behaviors.

Created by Jay Taylor and used by Gigawatt.

Requirements
  • Go version 1.3 or newer
Running the test suite
go test ./...
License

Permissive MIT license, see the LICENSE file for more information.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CancellableRetry

func CancellableRetry(config CancellableRetryConfig) (cancelFunc func() error)

func RetryUntilSuccess

func RetryUntilSuccess(name string, operation func() error, strategy backoff.BackOff)

retryUntilSuccess will keep attempting an operation until it succeeds.

Exponential backoff is used to prevent failing attempts from looping madly.

Types

type Action

type Action struct {
	Name string
	Func func() error
}

type CancellableRetryConfig

type CancellableRetryConfig struct {
	Actions         []Action
	DoneChan        chan struct{}
	BackoffProvider func() backoff.BackOff
	Debug           bool
	Quiet           bool
}

func (CancellableRetryConfig) ActionNames

func (config CancellableRetryConfig) ActionNames() string

Jump to

Keyboard shortcuts

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