kevinskrei
04/04/2019, 7:08 PM<http://GlobalScope.xxx|GlobalScope.xxx>
? For example
suspend fun sync() {
Realm.getDefaultInstance().use { realm ->
val variable = realm.getSomeVar()
val result = service.execute() //<- suspending function
val x = variable.y //<- Error because it returns to a different thread
}
}
Thank youwithoutclass
04/04/2019, 7:10 PMval realmDispatcher = Executors.newFixedThreadPool(1).asCoroutineDispatcher()