public ImageDownloadResult getImageDownloadResult ( ) throws Exception { Future < ImageDownloadResult > future = pool . poll ( ) ; if ( future == null ) { // no completed tasks in the pool return null ; } else { try { ImageDownloadResult imdr = future . get ( ) ; return imdr ; } catch ( Exception e ) { throw e ; } finally { // in any case (Exception or not) the numPendingTask should be reduced numPendingTasks -- ; } } }
Gets an image download results from the pool .