i have this rather simple question about the ThreadPoolExecutor. I have the following situation: I have to consume objects from a queue, create the appropiate worker tasks f
I used to work on an app with long running threads. We do this at shutdown,
BlockingQueue queue = threadPool.getQueue(); List list = new ArrayList(); int tasks = queue.drainTo(list);
The list is saved to a file. On startup, the list is added back to the pool so we don't lose any jobs.