Hello, I have a question about fixed thread pool...
# coroutines
i
Hello, I have a question about fixed thread pools. I see that fixed thread pools are now obsolete https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines/new-fixed-thread-pool-context.html Is there any suggested way to replace this? or should we continue with newFixedThredPoolContext (or java style executors) (Sorry for crospostng from #general)
w
I believe it’s still correct to do
Executors.newFixedThreadPool(COUNT).asCoroutineDispatcher()
i
Thanks. So what we do is using the Java convention enhanced with an extension function right?
w
Yes, with the
asCoroutineDispatcher()
extension, a Java
Executor
can be converted in to a dispatcher
i
Thank you very much, it was very helpful. that was something I was googling for hours.
w
You’re welcome 🙂