code: protected void removeExcessiveInProgressTasks(Queue<Exchange> exchanges, int limit) {
  
          while (exchanges.size() > limit) {
              // must remove last
              Exchange exchange = exchanges.poll();
              releaseTask(exchange);
          }
  
      }
docs: Drain any in progress files as we are done with this batch
  
  @param exchanges
  the exchanges
  @param limit
  the limit