Tong Zhang
04/28/2022, 3:09 AMTong Zhang
04/28/2022, 3:27 AMephemient
04/28/2022, 3:40 AM.join()
blocks the current coroutine until the job is completed
.cancel()
asynchronously cancels the job. it may continue running if it is in the middle of blocking code or withContext(NonCancellable) { }
`.cancel()`+`.join()` will cancel the job and wait for it to end. there is a .cancelAndJoin()
convenience extension function which is equivalent
.join()
+ .cancel()
will wait for the job to complete, and then cancel nothing. this is not useful