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

[2.x] UnicastSubject fail fast support #5217

Merged
merged 4 commits into from
Mar 23, 2017

Conversation

mostroverkhov
Copy link
Contributor

This PR adds support for fail-fast behavior to UnicastSubject with methods UnicastSubject<T> create(boolean delayError), UnicastSubject<T> create(int capacityHint, Runnable onTerminated, boolean delayError). Relates to #5165

* @return an UnicastSubject instance
*/
@CheckReturnValue
public static <T> UnicastSubject<T> create(int capacityHint, Runnable onTerminate, boolean delayError) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should this be marked Experimental?

* @return an UnicastSubject instance
*/
@CheckReturnValue
public static <T> UnicastSubject<T> create(boolean delayError) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should this be marked Experimental?

}

/**
* Creates an UnicastSubject with an internal buffer capacity hint 16 and given delay error flag
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: missing .

* @param capacityHint the capacity hint for the internal, unbounded queue
* @since 2.0
*/
UnicastSubject(int capacityHint) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this one really needed? The factories could just go and call UnicastSubject(capacityHint, true) ?

@codecov
Copy link

codecov bot commented Mar 23, 2017

Codecov Report

Merging #5217 into 2.x will decrease coverage by 0.04%.
The diff coverage is 97.5%.

@@             Coverage Diff              @@
##                2.x    #5217      +/-   ##
============================================
- Coverage     96.04%   95.99%   -0.05%     
- Complexity     5705     5711       +6     
============================================
  Files           624      624              
  Lines         40683    40705      +22     
  Branches       5648     5655       +7     
============================================
+ Hits          39075    39076       +1     
- Misses          632      655      +23     
+ Partials        976      974       -2
Impacted Files Coverage Δ Complexity Δ
...ain/java/io/reactivex/subjects/UnicastSubject.java 98.75% <97.5%> (-0.53%) 65 <12> (+12)
...in/java/io/reactivex/subjects/BehaviorSubject.java 83.93% <0%> (-7.78%) 55% <0%> (-2%)
...ava/io/reactivex/processors/BehaviorProcessor.java 86.78% <0%> (-4.85%) 60% <0%> (ø)
...rnal/subscriptions/DeferredScalarSubscription.java 93.84% <0%> (-4.62%) 27% <0%> (-1%)
...ctivex/internal/schedulers/AbstractDirectTask.java 95.65% <0%> (-4.35%) 15% <0%> (-1%)
...rnal/operators/completable/CompletableTimeout.java 94% <0%> (-4%) 2% <0%> (ø)
...ternal/operators/observable/ObservablePublish.java 92.1% <0%> (-3.51%) 10% <0%> (ø)
...internal/operators/completable/CompletableAmb.java 94.91% <0%> (-3.39%) 10% <0%> (-1%)
...n/java/io/reactivex/processors/AsyncProcessor.java 95.76% <0%> (-3.39%) 54% <0%> (-2%)
...activex/internal/operators/single/SingleCache.java 97.05% <0%> (-2.95%) 23% <0%> (-1%)
... and 42 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0e19566...efcd9a9. Read the comment docs.

Copy link
Member

@akarnokd akarnokd left a comment

Choose a reason for hiding this comment

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

Could you also do it for UnicastProcessor?

@@ -127,12 +128,13 @@
* @return an UnicastSubject instance
*/
Copy link
Member

Choose a reason for hiding this comment

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

Also please add @since 2.0.8 - experimental to all the new methods.

@mostroverkhov
Copy link
Contributor Author

Yes, will do that as separate PR

@akarnokd
Copy link
Member

Thanks!

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.

3 participants