Skip to content

Instantly share code, notes, and snippets.

@GauravChaddha1996
Created January 30, 2021 17:28
Show Gist options
  • Save GauravChaddha1996/75d0ca08b4bf578900c00959935be06b to your computer and use it in GitHub Desktop.
Save GauravChaddha1996/75d0ca08b4bf578900c00959935be06b to your computer and use it in GitHub Desktop.
val job = launch {
try {
// some work with a file
} finally {
// close the file here
}
}
job.cancelAndJoin()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment