Documentation ¶
Overview ¶
Package ctxutil provides context helpers.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DurationWithJitter ¶ added in v1.1.0
DurationWithJitter returns an exponential backoff duration based on attempt with random "full jitter". https://aws.amazon.com/blogs/architecture/exponential-backoff-and-jitter/
The maximum sleep is the cap. The minimum sleep is at least 3 milliseconds. Provided cap must be larger than minimum sleep, and attempt number must be a positive number.
func Sleep ¶ added in v0.7.0
Sleep pauses the current goroutine until d has passed or ctx is canceled.
func SleepWithJitter ¶ added in v1.1.0
SleepWithJitter pauses the current goroutine until d + jitter has passed or ctx is canceled.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.