The following piece of code tries to accompolish this.
The code loops forever and checks if there are any pending requests to be processed. If there is any, it creat
Since adding a shutdown hook to explicitly call shutdown() didn't work for me, I found an easy solution in Google's Guava: com.google.common.util.concurrent.MoreExecutors.getExitingExecutorService.
shutdown()