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

ibcoleman

02/23/2019, 6:05 PM
(Sorry, hit send too soon...)
getTESTInventoryPage(pg: Int)
makes a long-running SOAP call. I expected things to blow up--instead it appears to make the calls in an arbitrary order, but eight at a time (which happens to be the number of virtual cores on my machine. Which is exactly what I want. Which is extremely suspicious... 🙂
d

Dico

02/23/2019, 6:31 PM
GlobalScope
uses
Dispatchers.Default
which uses this behaviour. It will delegate to Java's
ForkJoinPool
shared instance
Dispatchers.Default
is a
CoroutineDispatcher
and thus an element of the
CoroutineContext
. It is automatically used if you dont explicitly specify a
CoroutineDispatcher
i

ibcoleman

02/23/2019, 10:21 PM
Thanks Dico, That's pretty great--I assumed that behavior out of the box was too good to be true.
K 1
5 Views