Handling Exceptions for ThreadPoolExecutor

后端 未结 3 1397
没有蜡笔的小新
没有蜡笔的小新 2020-12-03 03:00

I have the following code snippet that basically scans through the list of task that needs to be executed and each task is then given to the executor for execution.

3条回答
  •  既然无缘
    2020-12-03 03:46

    Subclass ThreadPoolExecutor and override its protected afterExecute (Runnable r, Throwable t) method.

    If you're creating a thread pool via the java.util.concurrent.Executors convenience class (which you're not), take at look at its source to see how it's invoking ThreadPoolExecutor.

提交回复
热议问题