https://kotlinlang.org logo
#rx
Title
# rx
b

Bruno_

06/27/2020, 1:06 PM
do you have any rules as to where to place subscribeOn/observeOn? some examples that come to my mind • e.g. subscribeOn io next to the io operation • always next to the subscribe • at the end of the function which creates the publisher • always right after creating the publisher by rules I mean conventions that you apply at work, in one of your projects or even your own ones
m

myanmarking

06/29/2020, 8:14 AM
it depends. the place you call subscribeOn/observeOn matter. Subscribe on is only applied once per observable (not sure if the first or last counts, think its the last one). SubscribeOn applies upstream, and observeOn downstream. So depending on the scenario, it may be irrelevant where you place your subscribeOn, but it may also produce different results
3 Views