https://kotlinlang.org logo
Title
l

louiscad

05/07/2019, 11:45 PM
Frankly, I'm wondering if
GlobalScope
should not be made experimental with something like
@WhyGlobalThingsAreBad
with some details on that special coroutines case of structured concurrency that should not be broken…
2
g

ghedeon

05/08/2019, 3:14 AM
That will give you false negative alarm when using GlobalScope with Rx
1
i

itnoles

05/08/2019, 4:24 AM
it should not uses on Android
g

ghedeon

05/08/2019, 5:12 AM
sorry, but I'd rather trust the guy who invented it and who says that using
GlobalScope
with rx types is totally fine. https://kotlinlang.slack.com/archives/C1CFAFJSK/p1548857935692300?thread_ts=1548856043.691400&cid=C1CFAFJSK
l

louiscad

05/08/2019, 8:26 AM
Then, name it
@BreakingStructuredConcurrency
or whatever, and for cases like this, just add the annotation at use site with
@UseExperimental
, or on the module.
p

Paulius Ruminas

05/08/2019, 1:10 PM
But it is not an experimental feature so that would be even more confusing? Maybe there should be a lint rule in android studio?
2
l

louiscad

05/08/2019, 2:11 PM
Coroutines are not Android only, so it should be an IDE inspection rather than a lint rule if it had to go that way. Or lint should be made more lightweight so it doesn't bloat build with lint check of non Android projects/modules
p

Paulius Ruminas

05/08/2019, 2:21 PM
I think it would produce a lot of false positives if it would be made as IDE inspection for every platform.
l

louiscad

05/08/2019, 4:05 PM
Lint would too. I prefer experimental annotations for this kind of thing though, because you can opt-in for a whole file, or a whole module.