func (w *MultiNotifyWatcher) loop(in <-chan struct{}) {
	defer close(w.changes)
	// out is initialised to m.changes to send the initial event.
	out := w.changes
	var timer <-chan time.Time
	for {
		select {
		case <-w.tomb.Dying():
			return
		case <-in:
			if timer == nil {
				// TODO(fwereade): 2016-03-17 lp:1558657
				timer = time.After(10 * time.Millisecond)
			}
		case <-timer:
			timer = nil
			out = w.changes
		case out <- struct{}{}:
			out = nil
		}
	}
}
// loop copies events from the input channel to the output channel,
// coalescing events by waiting a short time between receiving and
// sending.
loop copies events from the input channel to the output channel,
coalescing events by waiting a short time between receiving and
sending.
// loop copies events from the input channel to the output channel // coalescing events by waiting a short time between receiving and // sending .
func (w *MultiNotifyWatcher) loop(in <-chan struct{}) {
	defer close(w.changes)
	out := w.changes
	var timer <-chan time.Time
	for {
		select {
		case <-w.tomb.Dying():
			return
		case <-in:
			if timer == nil {
				timer = time.After(10 * time.Millisecond)
			}
		case <-timer:
			timer = nil
			out = w.changes
		case out <- struct{}{}:
			out = nil
		}
	}
}
func ( w * MultiNotifyWatcher ) loop ( in <- chan struct { } ) { defer close ( w . changes ) out := w . changes var timer <- chan time . Time for { select { case <- w . tomb . Dying ( ) : return case <- in : if timer == nil { timer = time . After ( 10 * time . Millisecond ) } case <- timer : timer = nil out = w . changes case out <- struct { } { } : out = nil } } }
loop copies events from the input channel to the output channel,
coalescing events by waiting a short time between receiving and
sending.
loop copies events from the input channel to the output channel coalescing events by waiting a short time between receiving and sending .
// out is initialised to m.changes to send the initial event. // TODO(fwereade): 2016-03-17 lp:1558657