eygraber
08/11/2021, 4:28 AMinterface MyDispatchers {
val main: CoroutineDispatcher
val io: CoroutineDispatcher
val computation: CoroutineDispatcher
val unconfined: CoroutineDispatcher
}
Instead of using Dispatchers.*
I use one of the properties from `MyDispatchers`(which are set to the corresponding Dispatchers.*
)
Is this necessary, or does the coroutines test artifact have a construct that allows you to use Dispatchers.*
and control them during a test?ephemient
08/11/2021, 8:33 AMeygraber
08/11/2021, 5:57 PMTestCoroutineDispatcher
(aside from Unconfined because of its behavior)?
Or am I better off using Dispatchers.*
and rely on the behavior of runBlockingTest
for time advancement, etc...
The reason I ask is because it's pretty clunky passing MyDispatchers
around, but I don't want to not use it, and paint myself into a corner later on if I need a test dispatcher.ephemient
08/11/2021, 6:05 PMeygraber
08/11/2021, 6:08 PMephemient
08/11/2021, 6:16 PMeygraber
08/11/2021, 6:41 PM