code: func (s *Service) StopAndTransfer() (fab.EventSnapshot, error) {
  	eventch, err := s.dispatcher.EventCh()
  	if err != nil {
  		logger.Warnf("Error stopping event service: %s", err)
  		return nil, err
  	}
  
  	snapshotch := make(chan fab.EventSnapshot)
  	errch := make(chan error)
  	eventch <- dispatcher.NewStopAndTransferEvent(snapshotch, errch)
  
  	select {
  	case snapshot := <-snapshotch:
  		return snapshot, nil
  	case err := <-errch:
  		logger.Warnf("Error while stopping dispatcher: %s", err)
  		return nil, err
  	case <-time.After(stopTimeout):
  		logger.Warnf("Timed out waiting for dispatcher to stop")
  		return nil, errors.New("timed out waiting for dispatcher to stop")
  	}
  }
docs: // StopAndTransfer stops the event service and transfers all event registrations into a snapshot.