paint-brush
Cancelling Coroutines in Kotlinby@timofeykrestyanov
1,446 reads
1,446 reads

Cancelling Coroutines in Kotlin

by Timofey Krestyanov3mJune 24th, 2022
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

Coroutines provide a simple undo mechanism to solve problems with long-running operations or memory leaks. The cancellation of a coroutine is fully thread-safe and non-blocking. We can use cancellation in coroutines for easy resource cleaning or possibly some form of error logging. If the job is canceled, a ‘CancellationException` will be thrown. We can also combine these two calls into the ‘job.cancelAndJoin()` function. If we need to wait for the Job to be complete, we can use the `job.join().
featured image - Cancelling Coroutines in Kotlin
Timofey Krestyanov HackerNoon profile picture
Timofey Krestyanov

Timofey Krestyanov

@timofeykrestyanov

I'm 5+ years of experience in building Mobile apps developer, I have worked on Android, and iOS projects

Learn More
LEARN MORE ABOUT @TIMOFEYKRESTYANOV'S
EXPERTISE AND PLACE ON THE INTERNET.
L O A D I N G
. . . comments & more!

About Author

Timofey Krestyanov HackerNoon profile picture
Timofey Krestyanov@timofeykrestyanov
I'm 5+ years of experience in building Mobile apps developer, I have worked on Android, and iOS projects

TOPICS

THIS ARTICLE WAS FEATURED IN...

Permanent on Arweave
Read on Terminal Reader
Read this story in a terminal
 Terminal
Read this story w/o Javascript
Read this story w/o Javascript
 Lite