Skip to content

OperatorAll - implement backpressure and include last value in exception cause #2986

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

Merged
merged 1 commit into from
May 28, 2015

Conversation

davidmoten
Copy link
Collaborator

Implemented backpressure using SingleDelayedProducer (thanks @akarnokd) and while I was there ensured that the last value is in the exception cause when the predicate throws an exception.

import java.util.concurrent.TimeUnit;

import org.apache.commons.math3.analysis.FunctionUtils;
Copy link
Member

Choose a reason for hiding this comment

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

External package reference!
import org.apache.commons.math3.analysis.FunctionUtils;

@davidmoten
Copy link
Collaborator Author

oops, fixed.

if (!result && !done) {
done = true;
child.onNext(false);
child.onCompleted();
producer.setValue(false);
unsubscribe();
} else {
// if we drop values we must replace them upstream as downstream won't receive and request more
Copy link
Member

Choose a reason for hiding this comment

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

This case is no longer necessary because the subscriber requests Long.MAX_VALUE upfront.

@davidmoten
Copy link
Collaborator Author

Thanks, I've updated the commit with that change.

@akarnokd
Copy link
Member

Looks good now. Thanks!

akarnokd added a commit that referenced this pull request May 28, 2015
OperatorAll  - implement backpressure and include last value in exception cause
@akarnokd akarnokd merged commit 6bb5539 into ReactiveX:1.x May 28, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants