I have some synchronous calls in my Scala code. I've wrapped them in a blocking() context and then in a Future: Future(blocking(syncCall())), but I don't know which type of ExecutionContext to use.
I know there may be a lot of possibilities and that there is not an ExecutionContext that it's the "best". I just need some information in order not to choose the worst because there is a lot of information out there and I have a mess in my head.
blocking
context if you're running this inside aFuture
. Why notFuture(syncCall())
? – BosonExecutionContext
doesn't do any thread scheduling on its own, but rather passes the job to the underlyingjava.util.concurrent.ExecutorService
. So your question boils down to the following: which type ofExecutorService
should one use for IO tasks. – Craigcraighead4.11
in the reading above. Introduce few system properties where you can define your thread-pool: maxPool size, initialPool size etc. – Jamie