void poll(ResponseInfoProcessor responseInfoProcessor) throws Exception {

    if (isShutDown && requestInfos.isEmpty() && responseInfos.isEmpty() && networkClientInflightRequestsEmpty()) {
      throw new ShutDownException();
    }

    ResponseInfo responseInfo = responseInfos.poll();
    if (responseInfo == null) {
      return;
    }

    executorService.submit(new Thread(() -> {
      try {
        responseInfoProcessor.process(responseInfo);
      } catch (Exception e) {
        logger.error("Encountered error while processing", e);
      } finally {
        maxParallelRequest.release();
      }
    }));
  }
Checks and processes if any responses are in the queue
@param responseInfoProcessor processor
@throws Exception
ambry-tools/src/main/java/com/github/ambry/tools/perf/serverperf/ServerPerfNetworkQueue.java