Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Context ¶
type Context struct {
// contains filtered or unexported fields
}
Context provides the ability to observe cancellation and termination requests from a Source. A termination request automatically triggers a corresponding cancellation request. This can be used to implement cancellation with two priority levels.
func (*Context) CancelErr ¶
CancelErr returns a non-nil error iff the context has been canceled or terminated.
func (*Context) Canceled ¶
func (c *Context) Canceled() <-chan struct{}
Canceled returns a channel that will be closed when the context is canceled or terminated.
func (*Context) TerminateErr ¶
TerminateErr returns a non-nil error iff the context has been terminated.
func (*Context) Terminated ¶
func (c *Context) Terminated() <-chan struct{}
Terminated returns a channel that will be closed when the context is terminated.
type Source ¶
type Source struct {
// contains filtered or unexported fields
}
Source provides the ability to deliver cancellation and termination requests to a Context. A termination request automatically triggers a corresponding cancellation request. This can be used to implement cancellation with two priority levels.