是否有使用當(dāng)前線程的ExecutorService?我所追求的是一種配置線程池使用的兼容方式。理想情況下,其余代碼不應(yīng)受到影響。我可以使用一個線程池與1個線程,但這不是我想要的。有任何想法嗎?ExecutorService es = threads == 0 ? new CurrentThreadExecutor() : Executors.newThreadPoolExecutor(threads);// es.execute / es.submit / new ExecutorCompletionService(es) etc
是否有使用當(dāng)前線程的ExecutorService?
慕田峪4524236
2019-08-13 15:40:32