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.
Click to show internal directories.
Click to hide internal directories.