Last active
July 7, 2021 11:45
-
-
Save adesamp/1da4d7efdf996a3bc478519d76fa3f08 to your computer and use it in GitHub Desktop.
JobTest
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
@Test | |
fun `Join Test`() { | |
runBlocking { | |
val job : Job = launch { println(Thread.currentThread().name) } | |
job.join() | |
} | |
} | |
@Test | |
fun `JoinAll Test`() { | |
runBlocking { | |
val job1 : Job = launch { println(Thread.currentThread().name) } | |
val job2 : Job = launch { println(Thread.currentThread().name) } | |
val job3 : Job = launch { println(Thread.currentThread().name) } | |
joinAll(job1,job2,job3) | |
} | |
} | |
@Test | |
fun `direct launch Test`() { | |
runBlocking { | |
launch { println(Thread.currentThread().name) } | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment