dewildte
11/24/2018, 10:34 PMinterface WorkerScope : CoroutineScope
An implementation might look like this:
private val workerScope: WorkerScope = object : WorkerScope {
override val coroutineContext: CoroutineContext =
Dispatchers.Default
}
For testing I do this:
internal object CoroutineTestingScope : CoroutineScope, WorkerScope, IOScope, MainScope {
override val coroutineContext: CoroutineContext =
Dispatchers.Unconfined
}