You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, this is related to a bad usage of Subject object. In the RxJava documentation (https://github.com/ReactiveX/RxJava/wiki/Subject#serializing), you can read that the Subject implementation isn't thread-safe. Only the SerializedSubject work as thread-safe, so to easy it, I have added the to-serialized function in the PR #23.
SerializerSubject add some buffering to the push, so if you want to have a similar behavior in your example code, you have to make the lock at pushing, for example, using this code:
In the output of the code below, on-value-total is on-value plus or minus one.
One possible output:
Another possible output:
The text was updated successfully, but these errors were encountered: