daily pastebin goal
0%
SHARE
TWEET

Untitled

a guest Jan 23rd, 2019 66 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import kotlinx.coroutines.*
  2.  
  3. fun main() = runBlocking {
  4.     launch {
  5.         println("Result: ${fakeQuery()}")
  6.     }
  7.     println("Main thread here")
  8. }
  9.  
  10. suspend fun fakeQuery(): Int {
  11.     delay(3000L)
  12.     println("Query is completed")
  13.     return 1
  14. }
  15.  
  16. /* Output
  17. Main thread here
  18. Query 1 is completed
  19. Result: 1
  20. */
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top