Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewDetached ¶
NewDetached returns a new context with the same values as the parent. This can be used to clone a context without inheriting the cancellation properities of the parent, meaning if the parent is cancelled, the child is not. Likewise, the child context does not cancel the parent. This can be useful when performing operations asyncronously.
Note that this goes against the designed behaviour of Go contexts and therefore this function should be used with caution. See similar: https://github.com/golang/tools/blob/master/internal/xcontext/xcontext.go
func NewDetachedWithTimeout ¶
func NewDetachedWithTimeout( parent context.Context, dur time.Duration, ) (context.Context, context.CancelFunc)
NewDetachedWithTimeout returns a new detached child context that cancels after the provided duration. It is not cancelled by the parent context.
Types ¶
This section is empty.