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

ObserveOn Error Handling #1683

Merged
merged 3 commits into from
Oct 2, 2014

Conversation

benjchristensen
Copy link
Member

Proposed solution for #1681 and #1680

It should delegate the toString to the Exception, not reach into the message. Some Exceptions don't have a message so this could print "null" and not show the exception type.
The queue will be drained to find and emit the onError.
... and doesn't allow intermittent onNext via a race of draining the queue and emitting (the draining thread must be where the skipping happens, not the producer thread).
@dpsm
Copy link
Contributor

dpsm commented Sep 11, 2014

LGTM

if (!on.accept(child, o)) {
// non-terminal event so let's increment count
emitted++;
if (failure) {
Copy link
Member Author

Choose a reason for hiding this comment

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

Conceptually a better way of doing this is for line 145 above to clear the queue and add just the single error.

There wasn't an obvious way to do in a thread-safe manner when I wrote this code ... but we can definitely improve to enable that.

benjchristensen added a commit that referenced this pull request Oct 2, 2014
@benjchristensen benjchristensen merged commit 67e463f into ReactiveX:1.x Oct 2, 2014
@benjchristensen benjchristensen deleted the observeOn-error branch October 2, 2014 22:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants