Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChanStopper ¶
ChanStopper implements the Stopper interface for users that loop over a select block
func NewChanStopper ¶
func NewChanStopper() *ChanStopper
func (*ChanStopper) Done ¶
func (s *ChanStopper) Done() bool
func (*ChanStopper) Finish ¶
func (s *ChanStopper) Finish()
func (*ChanStopper) OnDone ¶
func (s *ChanStopper) OnDone(f func())
func (*ChanStopper) Stop ¶
func (s *ChanStopper) Stop()
type Stopper ¶
type Stopper interface { // Stop asks the stoppee to stop its goroutines. Stop() // OnDone registers a callback to be fired once the stop is complete. OnDone(func()) // Finish is called by the stoppee when it has shut down. Finish() // Done returns true only after Done has been called. Done() bool }
Stopper is an embeddable interface for objects ("stoppees") which have goroutines that need to be stopped at the object's owner's request.
Click to show internal directories.
Click to hide internal directories.