utils

package
v0.0.0-...-0ba4654 Latest Latest
Warning

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

Go to latest
Published: May 17, 2021 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrTimeout = errors.New("call failed until timeout")

Functions

func CallUntilNoError

func CallUntilNoError(callback func(currentDelay time.Duration) error, initDelay time.Duration, maxDelay time.Duration)

CallUntilNoError will do callback and catch error, then sleep current goroutine by delay(will be up from initDelay to maxDelay), until the callback return nil.

initDelay will by up by 2 power until it great than or equal than maxDelay.

func CallUntilNoErrorWithTimeout

func CallUntilNoErrorWithTimeout(
	callback func(currentDelay time.Duration) error,
	initDelay time.Duration, maxDelay time.Duration, timeout time.Duration) error

CallUntilNoErrorWithTimeout means call CallUntilNoError but add a timeout that doing will not be endless

Types

This section is empty.

Jump to

Keyboard shortcuts

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