Cyrille QUÉMIN
07/11/2019, 11:18 AMbasher
07/11/2019, 2:00 PMbasher
07/11/2019, 2:00 PMbasher
07/11/2019, 2:01 PMCyrille QUÉMIN
07/11/2019, 2:43 PMKevin Gorham
07/19/2019, 5:11 PMkotlinx-coroutines-test
has Dispatchers.setMain
if this library did something similar then it might be easier to integrate with.basher
07/19/2019, 6:39 PMKevin Gorham
07/19/2019, 7:25 PMbasher
07/19/2019, 7:29 PMKevin Gorham
07/19/2019, 7:42 PMbasher
07/19/2019, 7:54 PMCoroutineWorker.execute
with launch
inside of a CoroutineScope
, for example. The API was designed to more closely match the Worker
API on native, since that's closer to what's actually happening behind the scenes on native. The general idea is that the coroutine abstraction is great and therefore worth the temporary pain of using CoroutineWorker
to help things along and allow writing coroutine-based async code. Then when full support on native comes, you can remove CoroutineWorker, do a small amount of cleanup, and be left with "idiomatic" coroutine codeKevin Gorham
07/19/2019, 10:28 PMbasher
07/19/2019, 10:45 PMlaunch
inside of a CoroutineScope
,".basher
07/19/2019, 10:47 PMmore specifically, an implementation of CoroutineDispatcherThis is the part that's not possible today in the current native memory concurrency model. I explained this in detail here (also mentioned GCD in that thread some where too): https://kotlinlang.slack.com/archives/C3PQML5NU/p1560272716107300?thread_ts=1560269181.105800&cid=C3PQML5NU