-
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
1.x: fix from(Iterable) error handling of Iterable/Iterator #3862
Conversation
o.onCompleted(); | ||
else | ||
} else { | ||
o.setProducer(new IterableProducer<T>(o, it)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to allocate and set the producer if unsubscribed? Seems like that check could enclose this whole if/else block.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure. updated.
👍 |
L93 no longer needs parameter void slowpath(long n) { |
👍 once last comment dealt with |
Actually, it should be using |
Yep I see, nice. |
👍 |
The
from(Iterable)
ignored non-fatal exceptions thrown by theIterable
andIterator
.Apart from wrapping the calls into
try-catch
, the overal emission algorithm has been changed:hasNext
only once for each available value. Since the subscribe() checks for an outright emptyIterable
, the drain loop runs only if it wasn't empty and does anotherhasNext
check immediately to complete immediately if possible.