task

package
v1.20.4-rc1 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2021 License: Apache-2.0 Imports: 4 Imported by: 59

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DoRetryWithTimeout

func DoRetryWithTimeout(t func() (interface{}, bool, error), timeout, timeBeforeRetry time.Duration) (interface{}, error)

DoRetryWithTimeout performs given task with given timeout and timeBeforeRetry TODO(stgleb): In future I would like to add context as a first param to this function so calling code can cancel task.

Types

type ErrTimedOut

type ErrTimedOut struct {
	// Reason is the reason for the timeout
	Reason string
}

ErrTimedOut is returned when an operation times out Is this type used anywhere? If not we can get rid off it in favor context.DeadlineExceeded

func (*ErrTimedOut) Error

func (e *ErrTimedOut) Error() string

Jump to

Keyboard shortcuts

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