code: func (c *Client) CloseIfIdle() bool {
  	logger.Debug("Attempting to close event client...")
  
  	// Check if there are any outstanding registrations
  	regInfoCh := make(chan *esdispatcher.RegistrationInfo)
  	err := c.Submit(esdispatcher.NewRegistrationInfoEvent(regInfoCh))
  	if err != nil {
  		logger.Debugf("Submit failed %s", err)
  		return false
  	}
  	regInfo := <-regInfoCh
  
  	logger.Debugf("Outstanding registrations: %d", regInfo.TotalRegistrations)
  
  	if regInfo.TotalRegistrations > 0 {
  		logger.Debugf("Cannot stop client since there are %d outstanding registrations", regInfo.TotalRegistrations)
  		return false
  	}
  
  	c.Close()
  
  	return true
  }
docs: // CloseIfIdle closes the connection to the event server only if there are no outstanding
  // registrations.
  // Returns true if the client was closed. In this case the client may no longer be used.
  // A return value of false indicates that the client could not be closed since
  // there was at least one registration.