https://kotlinlang.org logo
#splitties
Title
# splitties
w

wasyl

09/17/2019, 7:48 AM
Hi 🙂 I’m here from Louis’ mention in the other thread, I’m not sure how I missed Splitties, seems great! I’m looking through the available splits and have a question about lifecycle coroutines:
coroutineScope
and
lifecycleScope
and similarly defined to be
active until the Lifecycle[Owner] is destroyed.
. I’m not using coroutines in production yet, so maybe that’s a silly question, but do those scopes suspend if the lifecycle is in stopped state (similarly to LiveData waiting before delivering values)? Is it even possible (and reasonable) with scopes?
l

louiscad

09/17/2019, 10:52 AM
Hi! They don't, but AndroidX lifecycle KTX has it with
whenStarted
. I'll deprecate most of this split (
lifecycle-coroutines
) when AGP 3.6 is released (that fixes
Dispatchers.Main
performance issue), keeping only what's not in Lifecycle KTX.
w

wasyl

09/17/2019, 11:25 AM
when AGP 3.6 is released
what does AGP have to do with
Dispatchers.main
? Does it have something to do with the
Dispatchers.main.immediate
thing recently added to one of the androidx libraries (I think)?
w

wasyl

09/17/2019, 12:39 PM
Huh, pretty interesting, thanks 🙂
l

louiscad

09/17/2019, 12:43 PM
Of course, since Splitties is almost Kotlin-only (one Java file I can't convert in one module), I'll put
@Deprecated
annotations, so you can use it for now.
2 Views