Sergey Chikin
02/19/2018, 9:23 AMnewSingleThreadContext and newFixedThreadPoolContext provided by coroutines library out of box, and you can construct your own CoroutineContext based on any ExecutorService like this:
open class BaseCoroutineDispatcher(private val executor: ExecutorService) : CoroutineDispatcher() {
override fun dispatch(context: CoroutineContext, block: Runnable) {
executor.execute(block)
}
}