I have a viewmodel that triggers various objects' observables on a thread separate from the UI thread. At the same time, there's view code that is subscribing to these observables, which needs to update controls on the UI thread.
Is it better in terms of coding style to use ObserveOn
to ensure the OnNext handler runs on the UI thread (i.e. add ObserveOn
anywhere that can be triggered on another thread), or to have the viewmodel code responsible invoke/schedule on the UI thread (i.e. no ObserveOn
s needed, but one time ugly invoke/schedule lambda needed), or are either options as good as the other?