andreworobator
05/01/2019, 12:45 AMwithContext(...)
depending on what they’re doing. If withContext(<http://Dispatchers.IO|Dispatchers.IO>)
always runs on a background thread, how can we ensure single threading for testing purposes? Even runBlocking()
doesn’t affect this.pakoito
05/01/2019, 12:50 AMExecutors.newSingleThreadExecutor().asCoroutineDispatcher()
streetsofboston
05/01/2019, 1:06 AMandreworobator
05/01/2019, 1:17 AMThreadFactory
that just returns the current thread, then set that on a ThreadPoolExecutor
. Afterwards I would convert that into a Dispatcher
and provide that whenever launching a new coroutine in a testgildor
05/05/2019, 1:15 AM