Slide 8
Slide 8 text
public class FuturesA {
public static void run() throws Exception {
ExecutorService executor =
new ThreadPoolExecutor(4, 4, 1,
TimeUnit.MINUTES,
new LinkedBlockingQueue());
Future f1 = executor.submit(new CallToRemoteServiceA());
Future f2 = executor.submit(new CallToRemoteServiceB());
System.out.println(f1.get() + " - " + f2.get());
}
}
https://gist.github.com/benjchristensen/4670979
#Java Futures