Rechee Jozil
03/01/2021, 10:44 PMZach Klippenstein (he/him) [MOD]
03/01/2021, 10:56 PMRechee Jozil
03/01/2021, 10:58 PMZach Klippenstein (he/him) [MOD]
03/01/2021, 10:59 PM*Latest
) ones. But that only makes sense if you’re dealing with flows as inputRechee Jozil
03/01/2021, 11:16 PMZach Klippenstein (he/him) [MOD]
03/01/2021, 11:24 PMprivate var job: Job? = null
job?.cancel()
job = scope.launch { }
It’s very little boilerplate, and make it very clear what’s going on.myungpyo.shim
03/01/2021, 11:25 PMgildor
03/02/2021, 1:59 AMYou can define your own CoriutineScope and launch coroutines in the scope. and cancel the scope anytime you wantHow is this better than keeping reference on Job? I would argue that it worse, there is even higher chance that someone will add one more job to this Scope. Of course it useful if you run multiple jobs on this scope
myungpyo.shim
03/02/2021, 2:51 AM