Documentation ¶
Overview ¶
Package xcontext is a package to offer extra functionality for contexts that is not available from the standard context package.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CloseWhenDone ¶ added in v1.1.0
CloseWhenDone calls c.Close() when the Context is Done or the returned io.Closer is called, whichever comes first. It guarantees that c.Close() will be called at most once. Subsequent calls to the the returned io.Closer's Close method will return the error returned by c.Close().
Closing the returned io.Closer releases resources associated with it, so code should close the returned io.Closer as soon as c is no longer being used.
func IgnoreDeadline ¶
IgnoreDeadline returns a context that keeps all the values of its parent context but detaches from the cancellation and error handling.
KeepAlive should be preferred over IgnoreDeadline in most cases to prevent work from preventing shutdown.
Types ¶
This section is empty.