Created
July 31, 2018 11:41
-
-
Save JorgeCastilloPrz/39039382b80a09cb238d01db6d355c5d to your computer and use it in GitHub Desktop.
PolymorphicDeferredTest2.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 deferredModuleAlt = Module(DeferredK.async()) | |
deferredModuleAlt.run { | |
runBlocking { | |
try { | |
println(repository.allTasksByUser(user1).fix().unsafeAttemptSync()) | |
println(repository.allTasksByUser(user2).fix().unsafeAttemptSync()) | |
println(repository.allTasksByUser(user3).fix().unsafeAttemptSync()) | |
} catch (e: UserNotInRemoteStorage) { | |
println(e) | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment