code: func (ed *Dispatcher) disconnected() bool {
  	connectedPeer := ed.ConnectedPeer()
  	if connectedPeer == nil {
  		logger.Debugf("Not connected yet")
  		return false
  	}
  
  	logger.Debugf("Checking if event client should disconnect from peer [%s] on channel [%s]...", connectedPeer.URL(), ed.chConfig.ID())
  
  	peers, err := ed.discoveryService.GetPeers()
  	if err != nil {
  		logger.Warnf("Error calling peer resolver: %s", err)
  		return false
  	}
  
  	if !ed.peerResolver.ShouldDisconnect(peers, connectedPeer) {
  		logger.Debugf("Event client will not disconnect from peer [%s] on channel [%s]...", connectedPeer.URL(), ed.chConfig.ID())
  		return false
  	}
  
  	logger.Warnf("The peer resolver determined that the event client should be disconnected from connected peer [%s] on channel [%s]. Disconnecting ...", connectedPeer.URL(), ed.chConfig.ID())
  
  	if err := ed.disconnect(); err != nil {
  		logger.Warnf("Error disconnecting event client from peer [%s] on channel [%s]: %s", connectedPeer.URL(), ed.chConfig.ID(), err)
  		return false
  	}
  
  	logger.Warnf("Successfully disconnected event client from peer [%s] on channel [%s]", connectedPeer.URL(), ed.chConfig.ID())
  	return true
  }
docs: // disconnected checks if the currently connected peer should be disconnected
  // Returns true if the client has been disconnected; false otherwise