Why is there no scheduled cached thread pool provided by the Java Executors class?

前端 未结 4 478
庸人自扰
庸人自扰 2020-12-30 19:20

Executors provides newCachedThreadPool() and newScheduledThreadPool(), but not newCachedScheduledThreadPool(), what gives

4条回答
  •  自闭症患者
    2020-12-30 19:51

    Like skaffman says, Executors is only a collection of factory method. if you need a particular instance, you can always check all existing Executor implementors. In your case, i think that calling one of the various constructors of ScheduledThreadPoolExecutor would be a good idea.

提交回复
热议问题