Created
October 30, 2019 06:35
-
-
Save pencelab/ec4e9b92e01173f8d6a3c5ee07f93dec to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
runBlocking { | |
val defIsEven = operator.sumIsEvenAsync() | |
val defAverage = operator.sumAverageAsync() | |
launch { | |
try { | |
log("Operation [Is Even] Result = ${defIsEven.await()}") | |
} catch (e: Exception) { | |
log("Operation [Is Even] Caught: [ $e ]") | |
} finally { | |
log("--- NOTHING CONTAINING \"Operation [Is Even]\" SHOULD APPEAR AFTER THIS LINE ---") | |
delay(3000) | |
} | |
} | |
launch { | |
try { | |
log("Operation [Average] Result = ${defAverage.await()}") | |
} catch (e: Exception) { | |
log("Operation [Average] Caught: [ $e ]") | |
} finally { | |
log("--- NOTHING CONTAINING \"Operation [Average]\" SHOULD APPEAR AFTER THIS LINE ---") | |
delay(3000) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment