public ImageVectorizationResult getImageVectorizationResult ( ) throws Exception { Future < ImageVectorizationResult > future = pool . poll ( ) ; if ( future == null ) { return null ; } else { try { ImageVectorizationResult imvr = future . get ( ) ; return imvr ; } catch ( Exception e ) { throw e ; } finally { // in any case (Exception or not) the numPendingTask should be reduced numPendingTasks -- ; } } }
Takes and returns a vectorization result from the pool .