Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Closer ¶
type Closer struct {
// contains filtered or unexported fields
}
Closer holds the two things we need to close a goroutine and wait for it to finish: a chan to tell the goroutine to shut down, and a WaitGroup with which to wait for it to finish shutting down.
func (*Closer) AddRunning ¶
AddRunning Add()'s delta to the WaitGroup.
func (*Closer) Ctx ¶
Ctx can be used to get a context, which would automatically get cancelled when Signal is called.
func (*Closer) HasBeenClosed ¶
func (lc *Closer) HasBeenClosed() <-chan struct{}
HasBeenClosed gets signaled when Signal() is called.
func (*Closer) SignalAndWait ¶
func (lc *Closer) SignalAndWait()
SignalAndWait calls Signal(), then Wait().
Click to show internal directories.
Click to hide internal directories.