code: func (p *asyncRunPromise) followQuery(wg *sync.WaitGroup) {
  	defer wg.Done()
  	// Always need to call Done after query is finished.
  	defer p.q.Done()
  
  	select {
  	case <-p.ready:
  		// The promise was finished somewhere else, so we don't need to call p.finish.
  		// But we do need to cancel the flux. This could be a no-op.
  		p.q.Cancel()
  	case results, ok := <-p.q.Ready():
  		if !ok {
  			// Something went wrong with the flux. Set the error in the run result.
  			rr := &runResult{err: p.q.Err()}
  			p.finish(rr, nil)
  			return
  		}
  
  		// Exhaust the results so we don't leave unfinished iterators around.
  		var wg sync.WaitGroup
  		wg.Add(len(results))
  		for _, res := range results {
  			r := res
  			go func() {
  				defer wg.Done()
  				if err := exhaustResultIterators(r); err != nil {
  					p.logger.Info("Error exhausting result iterator", zap.Error(err), zap.String("name", r.Name()))
  				}
  			}()
  		}
  		wg.Wait()
  
  		// Otherwise, query was successful.
  		// TODO(mr): collect query statistics, once RunResult interface supports them?
  		p.finish(new(runResult), nil)
  	}
  }
docs: // followQuery waits for the query to become ready and sets p's results.
  // If the promise is finished somewhere else first, such as if it is canceled,
  // followQuery will return.