Example usage for org.springframework.util.concurrent ListenableFutureTask get

List of usage examples for org.springframework.util.concurrent ListenableFutureTask get

Introduction

In this page you can find the example usage for org.springframework.util.concurrent ListenableFutureTask get.

Prototype

V get() throws InterruptedException, ExecutionException;

Source Link

Document

Waits if necessary for the computation to complete, and then retrieves its result.

Usage

From source file:net.dryuf.concurrent.benchmark.NoListenerAsyncBenchmark.java

@Benchmark
@Warmup(iterations = WARMUP_ITERATIONS)/*from   w  w w  .j a va 2  s . c o  m*/
@Measurement(iterations = 2, batchSize = 1)
@Fork(warmups = 1, value = 1)
public void benchmarkSpring() throws ExecutionException, InterruptedException {
    org.springframework.util.concurrent.ListenableFutureTask[] array = BenchmarkSupport
            .populateSpringFutureArray(COUNT);
    BenchmarkSupport.threadedRunFutures(array);
    for (org.springframework.util.concurrent.ListenableFutureTask f : array) {
        f.get();
    }
}