Skip to content

Instantly share code, notes, and snippets.

@alokomkar
Created October 21, 2022 02:38
Show Gist options
  • Select an option

  • Save alokomkar/7ee3f9fdf244c96f3c5254f76bf2e1b8 to your computer and use it in GitHub Desktop.

Select an option

Save alokomkar/7ee3f9fdf244c96f3c5254f76bf2e1b8 to your computer and use it in GitHub Desktop.
Job in coroutines
val job = launch { // launch a new coroutine and keep a reference to its Job
delay(1000L)
println("World!")
}
println("Hello")
job.join() // wait until child coroutine completes
println("Done")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment