rudolf.hladik
01/28/2020, 4:40 PM1.3.3-native-mt
fun getDevice(success: (Device) -> Unit, failure: (Throwable?) -> Unit) {
GlobalScope.launch(IODispatcher) {
try {
withContext(ApplicationDispatcher) {
success(Device("noname", "ios", "13"))
}
} catch (ex: Exception) {
withContext(ApplicationDispatcher) {
failure(ex)
}
}
}
}