Skip to content
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

1.x: Avoid to call next when Iterator is drained #3528

Merged
merged 1 commit into from
Nov 16, 2015

Conversation

zsxwing
Copy link
Member

@zsxwing zsxwing commented Nov 16, 2015

delay delays the onCompleted event and unsubscribe is called when onCompleted finishes. So if we put a o.zipWith(Iterable, func) before delay, such as o.zipWith(Iterable, func).delay(...), o may keep emitting items even if zipWith emits an onCompleted event. This PR just fixed OperatorZipIterable to handle this case.

Fixes ReactiveX/RxScala#180


TestSubscriber<Integer> subscriber = new TestSubscriber<Integer>();
o.subscribe(subscriber);
scheduler.advanceTimeBy(1000, TimeUnit.DAYS.MILLISECONDS);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DAYS is unnecessary here.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops. Fixed.

@akarnokd akarnokd added the Bug label Nov 16, 2015
@akarnokd
Copy link
Member

👍

akarnokd added a commit that referenced this pull request Nov 16, 2015
1.x: Avoid to call next when Iterator is drained
@akarnokd akarnokd merged commit c5a4c37 into ReactiveX:1.x Nov 16, 2015
@akarnokd akarnokd added this to the 1.0.x milestone Nov 16, 2015
@zsxwing zsxwing deleted the zipIter-delay branch November 16, 2015 18:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants