I need to provide a ThreadLocal
to all the threads which end up running specific CompletableFuture.supplyAsync
Suppliers.
From the javadoc I see that CompletableFuture
uses "ForkJoinPool commonPool()
" which very much fits my performance use case.
How do I transfer a ThreadLocal
(and afterwards delete) to all pool threads running a specific CompletableFuture Supplier?
Remark:
I see that all CompletableFuture async
completion methods accept an Executor. I would love to use the
default ForkJoinPool commonPool()
but if this is not possible I guess I have to override ThreadPoolExecutor
and implement beforeExecute
?