wakingrufus
07/27/2018, 8:10 PMasync {
while(isActive){
....
}
return "something"
}
how can I cancel it so that I can call await
without getting a cancellation exception?wakingrufus
07/30/2018, 11:18 AMdave08
07/30/2018, 11:22 AMasync
is not like launch
in that if there's an exception, it bubbles it out to the caller, whereas launch
"swallows" it.dave08
07/30/2018, 11:25 AMasync {
return try {
while(isActive){
....
}
throw IllegalStateException("Not supposed to reach here")
} catch(e: CancellationException) {
"something"
}
}
wakingrufus
07/30/2018, 4:04 PM