retry

package
v0.0.0-...-fe13f99 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2018 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package retry allows multiple goroutines to function until it succeeds.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Retry

type Retry struct {
	// contains filtered or unexported fields
}

Retry is an object that will perform an action until it succeeds.

func (*Retry) Do

func (r *Retry) Do(f func() error) error

Do calls f once and returns the result of f until f returns nil. Once f return nil, calling Do on this instance no longer calls f even if f changes but simply returns nil. Calling Do on this instance with multiple goroutines gates calls to f so that only only one goroutine at a time calls f while the others block.

Jump to

Keyboard shortcuts

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