Created
July 31, 2018 11:00
-
-
Save JorgeCastilloPrz/5adea0ce892a21e0deeef2912386492a to your computer and use it in GitHub Desktop.
PolymorphicDeferredTest.kt
This file contains hidden or 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
object test { | |
@JvmStatic | |
fun main(args: Array<String>): Unit { | |
val user1 = User(UserId("user1")) | |
val user2 = User(UserId("user2")) | |
val user3 = User(UserId("unknown user")) | |
val deferredModule = Module(DeferredK.async()) | |
deferredModule.run { | |
runBlocking { | |
try { | |
println(repository.allTasksByUser(user1).fix().deferred.await()) | |
println(repository.allTasksByUser(user2).fix().deferred.await()) | |
println(repository.allTasksByUser(user3).fix().deferred.await()) | |
} catch (e: UserNotInRemoteStorage) { | |
println(e) | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment