Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrDying = errors.New("track: dying")
ErrDying is the error returned by Context.Err when the context is canceled.
Functions ¶
This section is empty.
Types ¶
type Context ¶
type Context interface { // Done returns a channel that's closed when work done on behalf of this // context should be closed. Successive calls to Done return the same value. // The close of the Done channel may happen asynchronously after the close or // cancel function called. // a Done channel for cancellation. Done() <-chan struct{} // Err returns the err for the goroutine death provided via Close // If Done is not yet closed, Err returns nil. // If Done is closed, Err returns ErrDying. // If Done is closed with Cancel function, Err returns custom error. Err() error // Close flags the goroutine as dying. Close() error // Cancel flags the goroutine as dying with custom error. // if error is nil, it will use ErrDying. Cancel(err error) error }
Context Context's methods may be called by multiple goroutines simultaneously.
Click to show internal directories.
Click to hide internal directories.