Simon Lin
08/26/2020, 7:56 AMval jobA = Job()
val jobB = GlobalScope.launch(jobA) {
delay(1000L)
println("World!")
}
What is the different between jobA and jobB?
If I would like to cancel the Job, which one need to be called? jobA.cancel() or jobB.cancel() ?
Thread in Slack ConversationLukas Lechner
08/26/2020, 7:57 AMjobA is parent of jobBLukas Lechner
08/26/2020, 7:57 AMJobA cancels all of its children jobsLukas Lechner
08/26/2020, 7:58 AMjobB only cancels itselfSimon Lin
08/26/2020, 8:01 AMAndrea Giuliano
08/26/2020, 8:02 AMLukas Lechner
08/26/2020, 8:23 AMjobB fails, but only calling .cancel() on it has no effect to the parentAndrea Giuliano
08/26/2020, 8:25 AMstreetsofboston
08/26/2020, 12:25 PM