Is it possible to force multiple RX subscriptions to different observables run serially (not simultaneously)?
I am aware that I can use EventLoopScheduler for that, but that will degrade performance because all handling will be done on a single thread.
If you mean to run one observable until
OnCompletedthen start the next, you should look intoConcat. If you mean to have multiple different observables that are subscribed to at the same time, you could useMerge(if the semantics make sense for your scenario). If Merge is not appropriate, I would recommend using one of the standard thread synchronization methods (lock, Monitor, etc) in the observer methods or the EventLoopScheduler you already know about.EDIT Original answer preserved below
Yes, it is possible to force serial observer execution. However, whether you need to or not depends on the observable. In general, hot observables will already run serially, whereas cold observables will not. This is a side-effect of the difference in the way hot and cold observables work. To make a cold observable hot, and thus make observers run serially, use
Publish. Here’s an example demonstrating the various behaviors.