code: func poller(interval, timeout time.Duration) WaitFunc {
  	return WaitFunc(func(done <-chan struct{}) <-chan struct{} {
  		ch := make(chan struct{})
  
  		go func() {
  			defer close(ch)
  
  			tick := time.NewTicker(interval)
  			defer tick.Stop()
  
  			var after <-chan time.Time
  			if timeout != 0 {
  				// time.After is more convenient, but it
  				// potentially leaves timers around much longer
  				// than necessary if we exit early.
  				timer := time.NewTimer(timeout)
  				after = timer.C
  				defer timer.Stop()
  			}
  
  			for {
  				select {
  				case <-tick.C:
  					// If the consumer isn't ready for this signal drop it and
  					// check the other channels.
  					select {
  					case ch <- struct{}{}:
  					default:
  					}
  				case <-after:
  					return
  				case <-done:
  					return
  				}
  			}
  		}()
  
  		return ch
  	})
  }
docs: // poller returns a WaitFunc that will send to the channel every interval until
  // timeout has elapsed and then closes the channel.
  //
  // Over very short intervals you may receive no ticks before the channel is
  // closed. A timeout of 0 is interpreted as an infinity, and in such a case
  // it would be the caller's responsibility to close the done channel.
  // Failure to do so would result in a leaked goroutine.
  //
  // Output ticks are not buffered. If the channel is not ready to receive an
  // item, the tick is skipped.