Kotlin provides its Dispatcher
interface for the purpose of dispatching coroutines, and default implementations in Dispatchers.Default
and Dispatchers.IO
, and you can use one as a Java Executor
with .asExecutor()
.
Java also provides its own implementation of Executor
in the form of ForkJoinPool.commonPool()
which I can use as a Dispatcher
with .asDispatcher()
.
So I can either use Kotlin’s default Dispatchers as Executors, or I can use Java’s default Executor as a Dispatcher.
Which one should I pick? I can’t seem to find any information on the pros and cons either way.
submitted by /u/jesseschalken
[link] [comments]