-
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
3.x: Observable.window(count, skip) completes windows when there are no observers #7056
Comments
Test case 1 does not subscribe to the first window in time thus the window gets abandoned and completed. This is the expected behavior. Test case 2 disposes the sequence and thus the abandoned windows will have no opportunity to emit their only item. |
@akarnokd There is a notice in the JavaDocs:
Could you kindly describe in more detail what kind of race conditions? From my point of view we can consider windows "active" once emitted, and care only about disposal of windows. And since they are I would appreciate your comments here. |
Up to one subscription. If such subscription ever happens then the upstream may never know it has to stop sending events. The race can happen in some operators, such as |
Thanks for such a good explanation, now it's clear. |
RxJava version: 3.0.5
OS: Android
Hi, in addition to #7048. Here are two failed test cases:
Test case 1:
This test will fail with following description:
Value count differs; expected: 2 [1, 2] but was: 1 [1] (latch = 0, values = 1, errors = 0, completions = 1)
Test case 2:
This test will fail with following description:
Value count differs; expected: 3 [1, 2, 3] but was: 0 [] (latch = 1, values = 0, errors = 0, completions = 0, disposed!)
Question
This is correct behavior?
The text was updated successfully, but these errors were encountered: