code: func (qs *queryResponseStream) Stream(resp *serf.QueryResponse) {
  	// Setup a timer for the query ending
  	remaining := resp.Deadline().Sub(time.Now())
  	done := time.After(remaining)
  
  	ackCh := resp.AckCh()
  	respCh := resp.ResponseCh()
  	for {
  		select {
  		case a := <-ackCh:
  			if err := qs.sendAck(a); err != nil {
  				qs.logger.Printf("[ERR] agent.ipc: Failed to stream ack to %v: %v", qs.client, err)
  				return
  			}
  		case r := <-respCh:
  			if err := qs.sendResponse(r.From, r.Payload); err != nil {
  				qs.logger.Printf("[ERR] agent.ipc: Failed to stream response to %v: %v", qs.client, err)
  				return
  			}
  		case <-done:
  			if err := qs.sendDone(); err != nil {
  				qs.logger.Printf("[ERR] agent.ipc: Failed to stream query end to %v: %v", qs.client, err)
  			}
  			return
  		}
  	}
  }
docs: // Stream is a long running routine used to stream the results of a query back to a client