question: get the next result from the stream , blocking until one is available . concode_field_sep ExecutorService executor concode_elem_sep Channel channel concode_elem_sep Supplier<Void> onChannelError concode_elem_sep ResponseQueue responseQueue concode_field_sep boolean isExhausted concode_elem_sep CompletableFuture<List<Result>> all concode_elem_sep Iterator<Result> iterator concode_elem_sep Stream<Result> stream concode_elem_sep boolean allItemsAvailable concode_elem_sep CompletableFuture<Integer> awaitItems concode_elem_sep int getAvailableItemCount
target: Result function ( ) { ResponseMessage loc0 = responseQueue . poll ( ) ; if ( loc0 != null ) return new Result ( loc0 ) ; awaitItems ( 1 ) . join ( ) ; loc0 = responseQueue . poll ( ) ; if ( loc0 != null ) return new Result ( loc0 ) ; else return null ; }