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 offer() method to Publish & Behavior Processors #5184

Merged
merged 2 commits into from
Mar 16, 2017

Conversation

akarnokd
Copy link
Member

This PR adds the boolean offer(T item) method to PublishProcessor and BehaviorProcessor to prevent MissingBackpressureException when one of the Subscribers is not ready to receive element by indicating a false return value. The sender can then retry the offer with any wait strategy it choses.

In addition, this PR adds Reactive-Streams Publisher TCK checks to verify AsyncProcessor, BehaviorProcessor, PublishProcessor, ReplayProcessor and UnicastProcessor as being Publishers. Unfortunately, the TCK can't verify them as Processor's because the TCK has certain expectations about how a Processor` should behave (namely: expects fail-fast, refCount-like nature).

@akarnokd akarnokd added this to the 2.1 milestone Mar 14, 2017
@codecov
Copy link

codecov bot commented Mar 14, 2017

Codecov Report

Merging #5184 into 2.x will increase coverage by 0.08%.
The diff coverage is 100%.

@@             Coverage Diff              @@
##                2.x    #5184      +/-   ##
============================================
+ Coverage     95.98%   96.07%   +0.08%     
- Complexity     5665     5679      +14     
============================================
  Files           621      621              
  Lines         40340    40364      +24     
  Branches       5616     5624       +8     
============================================
+ Hits          38722    38778      +56     
+ Misses          638      622      -16     
+ Partials        980      964      -16
Impacted Files Coverage Δ Complexity Δ
...java/io/reactivex/processors/PublishProcessor.java 98.29% <100%> (+0.17%) 45 <5> (+5)
...ava/io/reactivex/processors/BehaviorProcessor.java 93.39% <100%> (+6.94%) 62 <5> (+7)
...ternal/operators/flowable/FlowableSubscribeOn.java 91.52% <0%> (-6.78%) 2% <0%> (ø)
...rnal/subscriptions/ArrayCompositeSubscription.java 93.33% <0%> (-6.67%) 17% <0%> (-1%)
...vex/internal/operators/single/SingleTakeUntil.java 86.88% <0%> (-6.56%) 2% <0%> (ø)
.../operators/completable/CompletableConcatArray.java 93.75% <0%> (-6.25%) 2% <0%> (ø)
...ernal/operators/flowable/FlowableFromIterable.java 93.04% <0%> (-4.82%) 5% <0%> (ø)
...erators/completable/CompletableConcatIterable.java 95.91% <0%> (-4.09%) 2% <0%> (ø)
...nternal/operators/observable/ObservableCreate.java 95.53% <0%> (-3.58%) 2% <0%> (ø)
...vex/internal/operators/flowable/FlowableTimer.java 92.85% <0%> (-3.58%) 2% <0%> (ø)
... and 32 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 2d03fa9...a2aa0f0. Read the comment docs.

@akarnokd akarnokd merged commit 7673c09 into ReactiveX:2.x Mar 16, 2017
@akarnokd akarnokd deleted the SubjectOffer branch March 16, 2017 08:39
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.

1 participant