Skip to content

Instantly share code, notes, and snippets.

@adesamp
Last active July 7, 2021 11:45
Show Gist options
  • Save adesamp/1da4d7efdf996a3bc478519d76fa3f08 to your computer and use it in GitHub Desktop.
Save adesamp/1da4d7efdf996a3bc478519d76fa3f08 to your computer and use it in GitHub Desktop.
JobTest
@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