code: func (s *nodeStore) Add(n *api.Node, expireFunc func()) *registeredNode {
  	s.mu.Lock()
  	defer s.mu.Unlock()
  	var attempts int
  	var registered time.Time
  	if existRn, ok := s.nodes[n.ID]; ok {
  		attempts = existRn.Attempts
  		registered = existRn.Registered
  		existRn.Heartbeat.Stop()
  		delete(s.nodes, n.ID)
  	}
  	if registered.IsZero() {
  		registered = time.Now()
  	}
  	rn := &registeredNode{
  		SessionID:  identity.NewID(), // session ID is local to the dispatcher.
  		Node:       n,
  		Registered: registered,
  		Attempts:   attempts,
  		Disconnect: make(chan struct{}),
  	}
  	s.nodes[n.ID] = rn
  	rn.Heartbeat = heartbeat.New(s.periodChooser.Choose()*s.gracePeriodMultiplierNormal, expireFunc)
  	return rn
  }
docs: // Add adds new node and returns it, it replaces existing without notification.