Skip to content

Conversation

akarnokd
Copy link
Member

@akarnokd akarnokd commented Jan 23, 2020

Add the missing blockingSubscribe methods to Maybe, Single and Completable for symmetry with Flowable and Observable.

Usually we'd like to avoid blocking but now that Project Loom (preview) transparently turns latch-based awaiting into suspension inside Virtual Threads, they will act as free interop operators for exiting the reactive world into the continuation world.

Related: #6852

Marbles:

Maybe

image
image
image
image
image

Single

image
image
image
image

Completable

image
image
image
image

@akarnokd akarnokd added this to the 3.0 milestone Jan 23, 2020
@codecov
Copy link

codecov bot commented Jan 23, 2020

Codecov Report

Merging #6862 into 3.x will decrease coverage by 0.03%.
The diff coverage is 100%.

Impacted file tree graph

@@ Coverage Diff @@ ## 3.x #6862 +/- ## ============================================ - Coverage 98.28% 98.24% -0.04%  - Complexity 6380 6413 +33  ============================================ Files 715 716 +1 Lines 46524 46664 +140 Branches 6387 6396 +9 ============================================ + Hits 45726 45845 +119  - Misses 282 296 +14  - Partials 516 523 +7
Impacted Files Coverage Δ Complexity Δ
...ava3/internal/observers/BlockingMultiObserver.java 100% <100%> (ø) 23 <4> (+4) ⬆️
src/main/java/io/reactivex/rxjava3/core/Maybe.java 100% <100%> (ø) 183 <5> (+5) ⬆️
...in/java/io/reactivex/rxjava3/core/Completable.java 100% <100%> (ø) 124 <4> (+4) ⬆️
...rc/main/java/io/reactivex/rxjava3/core/Single.java 100% <100%> (ø) 155 <4> (+4) ⬆️
...nal/observers/BlockingDisposableMultiObserver.java 100% <100%> (ø) 20 <20> (?)
.../operators/observable/ObservableFlatMapSingle.java 88.88% <0%> (-6.35%) 2% <0%> (ø)
...java3/internal/observers/FutureSingleObserver.java 94.33% <0%> (-3.78%) 24% <0%> (-1%)
...nternal/operators/observable/ObservableCreate.java 94.87% <0%> (-3.42%) 2% <0%> (ø)
...ernal/operators/flowable/FlowableFlatMapMaybe.java 92.7% <0%> (-2.61%) 2% <0%> (ø)
...eactivex/rxjava3/processors/BehaviorProcessor.java 96.55% <0%> (-2.47%) 50% <0%> (ø)
... and 21 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 49f1a6d...4ae6b1b. Read the comment docs.

@akarnokd akarnokd merged commit 33a1dcf into ReactiveX:3.x Jan 24, 2020
@akarnokd akarnokd deleted the CompletableOps3x_0123 branch January 24, 2020 16:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

1 participant