Tong Zhang

04/28/2022, 3:09 AM
Why comment this line15 ,also get the same output? I follow offical doc,I don't known why already call cancel() method then call join(),Why not join() first then cancel(), What is the point of calling the join() method after cancel()


04/28/2022, 3:40 AM
blocks the current coroutine until the job is completed
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
convenience extension function which is equivalent
will wait for the job to complete, and then cancel nothing. this is not useful
👍 1