code: func (ed *Dispatcher) HandleStopEvent(e esdispatcher.Event) {
  	// Remove all registrations and close the associated event channels
  	// so that the client is notified that the registration has been removed
  	ed.clearConnectionRegistration()
  	if ed.peerMonitorDone != nil {
  		close(ed.peerMonitorDone)
  		ed.peerMonitorDone = nil
  	}
  
  	ed.Dispatcher.HandleStopEvent(e)
  }
docs: // HandleStopEvent handles a Stop event by clearing all registrations
  // and stopping the listener