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

pakoito

03/09/2018, 11:04 AM
@elizarov did you write any adapter between CoroutineContext and Rx Schedulers? Is there even any correlation?
j

Jonathan

03/09/2018, 11:04 AM
Scheduler.asCoroutineContext
exists
p

pakoito

03/09/2018, 11:04 AM
the other way around 😄
j

Jonathan

03/09/2018, 11:04 AM
oh sorry^^
p

pakoito

03/09/2018, 11:12 AM
our evil plan is to have an adapter to make Rx look like coroutines. Everything works now, except we only need to make the Coroutines into Schedulers
e

elizarov

03/09/2018, 11:16 AM
It should be quite straightforward to write adapter the other way around. We can include into
kotlinx.coroutines
if you care to send PR.
👍 1
p

pakoito

03/09/2018, 12:48 PM
Will the adapter be from CorroutineContext or from CoroutineDispatcher?
I’ll keep it on Arrow because we don’t depend on kotlinx except on the adapter module, happy to contribute the code back tho 😄
g

gildor

03/09/2018, 1:23 PM
I think it should be adapter from CoroutineDispatcher. CoroutineContext may not contain Disaptcher
p

pakoito

03/09/2018, 1:36 PM
problem is the Dispatcher isn’t available in the language, just in kotlinx
and the copypaste may be painful 😛
5 Views