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

spand

03/11/2019, 9:38 AM
Is
Dispatchers.setMain
also coming for js ?
g

gildor

03/11/2019, 9:52 AM
Do you mean Dispatchers.Main?
g

gildor

03/11/2019, 9:54 AM
ahhh
I see
but what exactly do you plan to set there in JS?
s

spand

03/11/2019, 9:56 AM
Not sure yet. Maybe
immediate
. Currently looking into some testing of our ui compoents in kotlin/js
Seems like it ought to be pretty analogous to testing in android
g

gildor

03/11/2019, 9:58 AM
but in js is exactly the same thing, there is only one thread, so immediate is not different from Main
s

spand

03/11/2019, 10:00 AM
Ah sorry. I meant
Unconfined
g

gildor

03/11/2019, 10:05 AM
This is also the same
There are no threads on JS, so Unconfined, Main and Default is actually the same thing
at least in terms of testing
s

spand

03/11/2019, 10:10 AM
That is not what I am seeing. Main/Default is async whereas Unconfined jobs are invoked synchronously
g

gildor

03/11/2019, 10:11 AM
hm, I see, maybe because of event queue, than it make sense
b

bdawg.io

03/12/2019, 4:23 AM
Unconfined is invoked immediately on the JVM too isn't it?
g

gildor

03/12/2019, 5:12 AM
yes, but it a bit more complicated, it also has an event queue inside to avoid some problems with blocking context
4 Views