I am using async construct to execute certain task in parallel.
ids.forEach { id -> val result = async { getResult(id) } }
I have 2 questions in this regard.
- I believe default thread pool to execute these tasks in parallel would have max(1, CPUs -1) threads. Is this understanding correct?
- I want to use custom thread pool instead.
val context = newFixedThreadPoolContext(15, "custom pool")
How can I pass this pool to the async construct. Please advice.