Versions in this module Expand all Collapse all v1 v1.0.1 May 18, 2017 Changes in this version + var ErrThrottled = errors.New("throttled on async limiting semaphore") + type Closer interface + Close func() + type CloserFn func() + func (f CloserFn) Close() + type Option interface + func OnPanic(handler func(interface{})) Option + func TrackTasks(enabled bool) Option + type Stopper struct + func NewStopper(options ...Option) *Stopper + func (s *Stopper) AddCloser(c Closer) + func (s *Stopper) IsStopped() <-chan struct{} + func (s *Stopper) NumTasks() int + func (s *Stopper) Quiesce(ctx context.Context) + func (s *Stopper) Recover(ctx context.Context) + func (s *Stopper) RunAsyncTask(ctx context.Context, f func(context.Context)) error + func (s *Stopper) RunLimitedAsyncTask(ctx context.Context, sem chan struct{}, wait bool, f func(context.Context)) error + func (s *Stopper) RunTask(ctx context.Context, f func(context.Context)) error + func (s *Stopper) RunTaskWithErr(ctx context.Context, f func(context.Context) error) error + func (s *Stopper) RunWorker(ctx context.Context, f func(context.Context)) + func (s *Stopper) RunningTasks() TaskMap + func (s *Stopper) ShouldQuiesce() <-chan struct{} + func (s *Stopper) ShouldStop() <-chan struct{} + func (s *Stopper) Stop(ctx context.Context) + func (s *Stopper) WithCancel(ctx context.Context) context.Context + type TaskMap map[string]int + func (tm TaskMap) String() string