1.X: UnicastSubject fail-fast and delay-error behavior#5195
Merged
akarnokd merged 2 commits intoReactiveX:1.xfrom Mar 18, 2017
Merged
1.X: UnicastSubject fail-fast and delay-error behavior#5195akarnokd merged 2 commits intoReactiveX:1.xfrom
akarnokd merged 2 commits intoReactiveX:1.xfrom
Conversation
…iption if onError is also called prior to subscription.
Codecov Report
@@ Coverage Diff @@
## 1.x #5195 +/- ##
============================================
+ Coverage 84.36% 84.38% +0.02%
- Complexity 2880 2883 +3
============================================
Files 290 290
Lines 18115 18123 +8
Branches 2478 2479 +1
============================================
+ Hits 15282 15293 +11
+ Misses 1964 1961 -3
Partials 869 869
Continue to review full report at Codecov.
|
akarnokd
reviewed
Mar 18, 2017
| boolean empty = q.isEmpty(); | ||
|
|
||
| if (checkTerminated(d, empty, s)) { | ||
| if (checkTerminated(d, empty, delayError, s)) { |
Member
There was a problem hiding this comment.
You should have a local delayError field for this, otherwise you are re-reading the flag on each emission which can cause unnecessary false sharing.
Queue<Object> q = queue;
boolean delayError = this.delayError;
// ...
akarnokd
approved these changes
Mar 18, 2017
Member
|
Thanks! |
This was referenced Mar 20, 2017
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds support for delay-error behavior to
UnicastSubjectwith methodsUnicastSubject<T> create(boolean delayError),UnicastSubject<T> create(int capacityHint, Action0 onTerminated, boolean delayError). Behavior of existing factory methods was not changed, and is fail-fast.Relates to #5165