ScheduledExecutorService Exception handling

前端 未结 7 2071
再見小時候
再見小時候 2020-11-28 22:57

I use ScheduledExecutorService to execute a method periodically.

p-code:

ScheduledExecutorService scheduler = Executors.newSingleThreadScheduledExecu         


        
7条回答
  •  情书的邮戳
    2020-11-28 23:12

    Any exception in the run() of a thread which is passed to (ScheduledExecutorService) is never thrown out and if we use future.get() to get status, then the main thread waits infinitely

提交回复
热议问题