code: func (d *Dispatcher) markNodeReady(ctx context.Context, nodeID string, description *api.NodeDescription, addr string) error {
  	d.nodeUpdatesLock.Lock()
  	d.nodeUpdates[nodeID] = nodeUpdate{
  		status: &api.NodeStatus{
  			State: api.NodeStatus_READY,
  			Addr:  addr,
  		},
  		description: description,
  	}
  	numUpdates := len(d.nodeUpdates)
  	d.nodeUpdatesLock.Unlock()
  
  	// Node is marked ready. Remove the node from down nodes if it
  	// is there.
  	d.downNodes.Delete(nodeID)
  
  	if numUpdates >= maxBatchItems {
  		select {
  		case d.processUpdatesTrigger <- struct{}{}:
  		case <-ctx.Done():
  			return ctx.Err()
  		}
  
  	}
  
  	// Wait until the node update batch happens before unblocking register.
  	d.processUpdatesLock.Lock()
  	defer d.processUpdatesLock.Unlock()
  
  	select {
  	case <-ctx.Done():
  		return ctx.Err()
  	default:
  	}
  	d.processUpdatesCond.Wait()
  
  	return nil
  }
docs: // markNodeReady updates the description of a node, updates its address, and sets status to READY
  // this is used during registration when a new node description is provided
  // and during node updates when the node description changes