Mina Eweida
12/11/2020, 10:54 AMMainScope
already tested that on my project, so would it make sense if this is provided in Reaktive through coroutine-interop?Arkadii Ivanov
12/11/2020, 11:49 AM-nmtc
version of Reaktive coroutines-interop
module.Mina Eweida
12/11/2020, 2:23 PMsingleFromCoroutine
because you cannot specify dispatcher. It’s always Dispatcher.Unconfined
but maybe there could be some flexibility thereArkadii Ivanov
12/11/2020, 3:47 PMsingleFromCoroutine {}
.subscribeOn(ioScheduler)
Arkadii Ivanov
12/11/2020, 3:47 PMMina Eweida
12/11/2020, 4:12 PMMina Eweida
12/11/2020, 4:12 PMMina Eweida
12/11/2020, 4:13 PMArkadii Ivanov
12/11/2020, 4:21 PMMina Eweida
12/11/2020, 4:22 PMMina Eweida
12/11/2020, 4:22 PMArkadii Ivanov
12/11/2020, 4:26 PMsingleFromCoroutine { /* Call Ktor, does not matter what is the dispatcher/thread here */ }
.observeOn(computationScheduler)
.map { /* parse the response on background thread /* }
.observeOn(mainScheduler)
.susbcribe(isThreadLocal = true) { /* Update the UI on main thread /* }