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
{{ message }}
This repository has been archived by the owner on Feb 25, 2022. It is now read-only.
[ ] Nothing, completes normally
[ ] Throws MissingBackpressureException
[ ] Throws OnErrorNotImplementedException
[X] Goes into an infinite loop
The operator repeat resubscribes to the source when it completes. In this case, the empty() completes immediately, gets resubscribed and completes immediately again, ad infinitum.
Note that the same thing can happen with terminated subjects such as PublishSubject and BehaviorSubject or an empty ReplaySubject!
Takeaway: never repeat a source indefinitely, especially from an unknown source.
[X] Prints main
[ ] Prints 1
[ ] Prints RxComputationScheduler-1
[ ] Throws an Exception
The operator subscribeOn has no effect on a running PublishSubject because it doesn't have any visible subscription side-effects. However the other subjects may signal a value or completion on the given Scheduler.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
This issue, similar to #21, collects some interesting cases and pitfalls in the form of Java Puzzlers, giving a scenario and offering 4-6 answers.
The text was updated successfully, but these errors were encountered: