Two of my subjects running network calls on separate threads will update another subject once they fetch their data. My question is, what would happen if they both send a value to the subject at the exact same time?
From the book Intro to Rx:
Avoid the use of the subject types. Rx is effectively a functional programming paradigm. Using subjects means we are now managing state, which is potentially mutating. Dealing with both mutating state and asynchronous programming at the same time is very hard to get right. Furthermore, many of the operators (extension methods) have been carefully written to ensure that correct and consistent lifetime of subscriptions and sequences is maintained; when you introduce subjects, you can break this.
IE, Subjects are not thread safe. If you call on(_:) on a Subject from two different threads, they can cause a synchronization anomaly and break the observable sequence grammar.
In other words, you are risking a race condition. Best case, you just get a warning while in debug mode. Worst case, your app crashes in some mysterious unidentifiable way, far from where the problem actually occurred.
Another quote from the book:
Subjects provide a convenient way to poke around Rx, however they are not recommended for day to day use... Instead of using subjects, favor the factory methods...