Dias
01/31/2019, 5:16 PMselect
statement, etchalley
01/31/2019, 7:38 PMDias
01/31/2019, 7:58 PMDias
01/31/2019, 7:59 PMhalley
01/31/2019, 8:01 PMsuspend fun <V : Any, E : Exception> SuspendableResult<V, E>.recover(transform: suspend (E) -> V): SuspendableResult<V, E> {
return when (this) {
is SuspendableResult.Success -> this
is SuspendableResult.Failure -> SuspendableResult.of{ transform(this.error) }
}
}
Dico
02/01/2019, 7:21 AMlaunch (NonCancellable) {
val first = async { ... }
val second = async { ... }
val results = try {
first.await()
} catch (e: Exception) {
second.await()
}
}
Dias
02/01/2019, 10:21 AMDias
02/01/2019, 10:21 AMDico
02/01/2019, 2:24 PMDias
02/01/2019, 2:25 PMhalley
02/01/2019, 2:41 PMDias
02/01/2019, 4:30 PM