<@U0BFDUP0E> A coroutines threading model is diffe...
# coroutines
e
@jw A coroutines threading model is different from Rx threading model. In Rx the thread your code runs in is implicitly controlled by various onXXX operators up/down the stream, while in coroutines the thread (context) is explicitly specified for each coroutine. The only exception is
Unconfined
context, which leaves the thread “unspecified”.
j
The on* operators have no effect on threading and are much more like Unconfined where they run on whatever thread is emitting (which is true of nearly all operators). Did you mean observeOn/subscribeOn?
But anyway I have the current context (via
coroutineContext
) and the target context so I figured that I could replicate observeOn by having the current context loop and then send values across a channel onto a loop in the target context.
e
I meant observeOn/subscribeOn, thanks