Skip to content

Instantly share code, notes, and snippets.

@aqua30
Last active June 23, 2022 17:20
Show Gist options
  • Select an option

  • Save aqua30/3158a4ab9d8d8d5e61acf32982e7a8ad to your computer and use it in GitHub Desktop.

Select an option

Save aqua30/3158a4ab9d8d8d5e61acf32982e7a8ad to your computer and use it in GitHub Desktop.
runBlocking {
Log.e("TAG","starting runBlocking")
val job = launch {
Log.e("TAG","starting launch block")
repeat(1000) {
Log.e("TAG","$it")
delay(500)
}
}
delay(2000)
job.cancelAndJoin()
Log.e("TAG","job cancelled")
}
Log.e("TAG","Printing normally on thread ${this.javaClass.name}")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment