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