Documentation
¶
Overview ¶
Package context contains helper utilities regarding go contexts.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var TerminatesQuicklyTimeout = 20 * time.Millisecond
TerminatesQuicklyTimeout is the timeout that TerminatesQuickly uses.
Functions ¶
func IsContextError ¶
IsContextError returns whether the given error originates from a context that was cancelled or whose deadline exceeded. Prior to checking, the error is unwrapped by calling errors.Cause.
func IsDone ¶
func IsDone(ctx interface{ Done() <-chan struct{} }) bool
IsDone returns whether ctx is done.
func Terminates ¶
Terminates checks whether a function terminates within a certain timeout.
func TerminatesCtx ¶
TerminatesCtx checks whether a function terminates before a context is done.
func TerminatesQuickly ¶
func TerminatesQuickly(fn func()) bool
TerminatesQuickly checks whether a function terminates within 20 ms.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.