code: func (s *Service) Stop() {
  	eventch, err := s.dispatcher.EventCh()
  	if err != nil {
  		logger.Warnf("Error stopping event service: %s", err)
  		return
  	}
  
  	errch := make(chan error)
  	eventch <- dispatcher.NewStopEvent(errch)
  
  	select {
  	case err := <-errch:
  		if err != nil {
  			logger.Warnf("Error while stopping dispatcher: %s", err)
  		}
  	case <-time.After(stopTimeout):
  		logger.Infof("Timed out waiting for dispatcher to stop")
  	}
  }
docs: // Stop stops the event service