https://kotlinlang.org logo
#coroutines
Title
# coroutines
j

Joey Heck

11/30/2018, 8:03 PM
Copy code
val job = GlobalScope.launch {
    <How do I access the Job from here>
}
t

Timmy

11/30/2018, 9:05 PM
Sounds like an excellent use case for structured concurrency. Instead of launching all these tasks on the GlobalScope just launch them from your own CoroutineScope. All the cancellation and error propagation is already implemented.
👍 1
j

Joey Heck

11/30/2018, 10:51 PM
I think this does solve it! I was just doing these with Activities, but now I am doing a standalone one for this, and it seems to work great!
5 Views