title: How to globally set thread pool for all CompletableFuture
body: <p>I am trying to mimic what single threaded async programming in Javascript in Java with the use of async / await library by EA (<a href="https://github.com/electronicarts/ea-async" rel="nofollow noreferrer">ea-async</a>). This is mainly because I do not have long-lasting CPU bound computations in my program and I want to code single thread lock free code in Java.</p>
  
  <p>ea-async library heavily relies on the CompletableFuture in Java and underneath Java seems to use ForkJoinPool to run the async callbacks. This puts me into multi threaded environment as my CPU is multi-core. It seems for every CompletableFuture task, I can supply async with my custom thread pool executor. I can supply <code>Executors.newSingleThreadExecutor()</code> for this but I need a way to set this globally so that all CompletableFuture will be using this executor within the single JVM process. How do I do this?</p>