code: func (s *Snapshotter) teeStream() {
  	flushEvent := func(e Event) {
  		// Forward to the internal stream, do not block
  		select {
  		case s.streamCh <- e:
  		default:
  		}
  
  		// Forward the event immediately, do not block
  		if s.outCh != nil {
  			select {
  			case s.outCh <- e:
  			default:
  			}
  		}
  	}
  
  OUTER:
  	for {
  		select {
  		case e := <-s.inCh:
  			flushEvent(e)
  		case <-s.shutdownCh:
  			break OUTER
  		}
  	}
  
  	// Drain any remaining events before exiting
  	for {
  		select {
  		case e := <-s.inCh:
  			flushEvent(e)
  		default:
  			return
  		}
  	}
  }
docs: // teeStream is a long running routine that is used to copy events
  // to the output channel and the internal event handler.