Documentation ¶
Overview ¶
Package ctxutils defines context utility functions.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithFail ¶
WithFail returns a copy of parent with a new Done channel. The returned context's Done channel is closed when the returned fail function is called or when the parent context's Done channel is closed, whichever happens first. Fail semantic is the following: when the context has yet to be cancelled - so fail is called for the first time - it cancel the associated context and return the error; subsequent calls to fail result in no further action, returning the first error.
Calling fail on this context releases resources associated with it, so code should call it as soon as the operations running in this Context complete. Fail is thread safe
Types ¶
This section is empty.