code: func (s *Server) StreamAggregatedResources(stream ADSStream) error {
  	// a channel for receiving incoming requests
  	reqCh := make(chan *envoy.DiscoveryRequest)
  	reqStop := int32(0)
  	go func() {
  		for {
  			req, err := stream.Recv()
  			if atomic.LoadInt32(&reqStop) != 0 {
  				return
  			}
  			if err != nil {
  				close(reqCh)
  				return
  			}
  			reqCh <- req
  		}
  	}()
  
  	err := s.process(stream, reqCh)
  	if err != nil {
  		s.Logger.Printf("[DEBUG] Error handling ADS stream: %s", err)
  	}
  
  	// prevents writing to a closed channel if send failed on blocked recv
  	atomic.StoreInt32(&reqStop, 1)
  
  	return err
  }
docs: // StreamAggregatedResources implements
  // envoydisco.AggregatedDiscoveryServiceServer. This is the ADS endpoint which is
  // the only xDS API we directly support for now.