-
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
2.x UnicastProcessor fail-fast support #5226
2.x UnicastProcessor fail-fast support #5226
Conversation
@CheckReturnValue | ||
@Experimental | ||
public static <T> UnicastProcessor<T> create(int capacityHint, Runnable onCancelled, boolean delayError) { | ||
return new UnicastProcessor<T>(capacityHint, onCancelled,delayError); |
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.
nit: newline between onCancelled,delayError
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.
Space.
return new UnicastProcessor<T>(capacityHint, onCancelled,delayError); | ||
} | ||
|
||
/** | ||
* Creates an UnicastProcessor with the given capacity hint. | ||
* @param capacityHint the capacity hint for the internal, unbounded queue | ||
* @since 2.0 | ||
*/ | ||
UnicastProcessor(int capacityHint) { |
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.
Is this one really necessary?
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.
could you elaborate a bit?
Codecov Report
@@ Coverage Diff @@
## 2.x #5226 +/- ##
============================================
+ Coverage 96.01% 96.07% +0.06%
- Complexity 5747 5758 +11
============================================
Files 628 628
Lines 41085 41099 +14
Branches 5698 5703 +5
============================================
+ Hits 39446 39485 +39
+ Misses 657 642 -15
+ Partials 982 972 -10
Continue to review full report at Codecov.
|
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.
One of the new package-private constructors is unnecessary.
* @param delayError deliver pending onNext events before onError | ||
* @since 2.0.8 - experimental | ||
*/ | ||
UnicastProcessor(int capacityHint, boolean delayError) { |
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.
This is unnecessary.
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.
3 args constructor has non-null onTerminate check; should i move this check to factory?
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.
Could you move that check into the appropriate create
method(s)?
…tory methods, fixed typo
This PR adds support for fail-fast behavior to
UnicastProcessor
with methodsUnicastProcessor<T> create(boolean delayError)
,UnicastProcessor<T> create(int capacityHint, Runnable onTerminated, boolean delayError)
. Relates to #5165, #5217