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: add tryOnError to create/XEmitter API #5344

Merged
merged 2 commits into from
May 16, 2017
Merged

Conversation

akarnokd
Copy link
Member

This PR adds the tryOnError method to the various Emitter types used in the create operators that allows the developer to avoid the UndeliverableException in case a cancellation is racing with the emission of an error. The return value indicates a success of the delivery; in case of false, the developer can decide to log/drop the specific error if that makes sense for him/her.

@akarnokd akarnokd added this to the 2.2 milestone May 16, 2017
@codecov
Copy link

codecov bot commented May 16, 2017

Codecov Report

Merging #5344 into 2.x will increase coverage by 0.1%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff             @@
##                2.x    #5344     +/-   ##
===========================================
+ Coverage     96.08%   96.18%   +0.1%     
- Complexity     5770     5782     +12     
===========================================
  Files           630      630             
  Lines         41146    41162     +16     
  Branches       5714     5721      +7     
===========================================
+ Hits          39536    39593     +57     
+ Misses          633      613     -20     
+ Partials        977      956     -21
Impacted Files Coverage Δ Complexity Δ
...eactivex/internal/operators/maybe/MaybeCreate.java 92% <100%> (+0.33%) 2 <0> (ø) ⬇️
...ernal/operators/completable/CompletableCreate.java 95.12% <100%> (+2.81%) 2 <0> (ø) ⬇️
...nternal/operators/observable/ObservableCreate.java 98.29% <100%> (-0.82%) 2 <0> (ø)
...ex/internal/operators/flowable/FlowableCreate.java 96.77% <100%> (-0.94%) 6 <0> (ø)
...ctivex/internal/operators/single/SingleCreate.java 95.34% <100%> (+0.22%) 2 <0> (ø) ⬇️
...vex/internal/operators/single/SingleTakeUntil.java 86.88% <0%> (-6.56%) 2% <0%> (ø)
...in/java/io/reactivex/subjects/BehaviorSubject.java 85.93% <0%> (-5.73%) 56% <0%> (ø)
.../operators/flowable/FlowableBlockingSubscribe.java 91.66% <0%> (-5.56%) 9% <0%> (-1%)
...internal/operators/completable/CompletableAmb.java 94.91% <0%> (-3.39%) 10% <0%> (-1%)
...x/internal/operators/maybe/MaybeSwitchIfEmpty.java 97.22% <0%> (-2.78%) 2% <0%> (ø)
... and 46 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 ea6c7de...8bec89d. Read the comment docs.

RxJavaPlugins.onError(t);
}
}

@Override
Copy link
Collaborator

Choose a reason for hiding this comment

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

indentation seems off

@akarnokd akarnokd merged commit 8bf04e9 into ReactiveX:2.x May 16, 2017
@akarnokd akarnokd deleted the TryOnError branch May 16, 2017 18:24

@Test
public void tryOnError() {
for (BackpressureStrategy strategy : BackpressureStrategy.values()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

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.

4 participants