Answer the question
In order to leave comments, you need to log in
Executing coroutines in a thread pool?
Text from the article:
You can execute coroutines on any of your application's thread pools by converting them to a CoroutineDispatcher using the Executor.asCoroutineDispatcher() extension function. Alternatively, you can use the default Dispatchers that come with the coroutine library.
That is, the author says that I can write like that? Or about something else?
val executor = Executors.newFixedThreadPool(3).asCoroutineDispatcher()
val myCoroutine = CoroutineScope(executor).launch {}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question