-
Notifications
You must be signed in to change notification settings - Fork 7.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BehaviorSubject(1).toBlockingObservable.next.iterator.next() never completes #624
Comments
This might be a bug in the underlying |
I think you need the |
Each time you fetch an item from the iterator returned by |
I'm not sure I follow. Exactly at which point has Thank you very much. |
In the current RxJava version, when the code comes to In Hope it clears things. |
That clarifies a lot to me about the implementation. Furthermore, you have pointed me to the Thank you indeed, |
I confirmed that it does not work: System.out.println(BehaviorSubject.create(1).take(1).toBlockingObservable().single());
System.out.println(BehaviorSubject.create(1).toBlockingObservable().next().iterator().next()); Someone will need to spend some time looking at |
Interestingly this one works: System.out.println(BehaviorSubject.create(1).toBlockingObservable().toIterable().iterator().next()); |
I had an explanation some time ago. Bottom line is that the next() can't work in this setup. |
As of 0.20-RC3 these work: System.out.println(BehaviorSubject.create(1).take(1).toBlocking().single());
System.out.println(BehaviorSubject.create(2).toBlocking().toIterable().iterator().next()); this still does not: System.out.println(BehaviorSubject.create(3).toBlocking().next().iterator().next()); |
A possible fix that allows the 3rd behavior is in #1501 |
The scala expression
never completes as of RxJava 0.15.1
To my understanding, it should simply return 1, since BehaviorSubject always has at least one value to provide. The fact that the following scala code correctly returns 1:
assures me about this assumption even more firmly. Is this a bug in the implementation, or do I misunderstand something?
Thank you, best regards,
Tomáš Dvořák
The text was updated successfully, but these errors were encountered: