Showing posts with label Concurrent. Show all posts
Showing posts with label Concurrent. Show all posts

Monday, September 23, 2019

Use ExecutorService to Run Multiple Callable and Get Results In Order

Motivation

ExecutorService can run multiple Runnable/Callable, but there is no method for get their Results / Exception in order
(Similar to Promise.all in JavaScript)

So try to build a simple solution.

Simple Note

Test / Sample
  ConcurrentParallel.java
Implementation to Run Multiple Callable
  CallableParallelExecutor.java
Wrapper Class to wrap Callable
  CallableWrapper.java