Skip to content

Commit a8ba158

Browse files
authored
2.x: Update marble diagrams for sample overloads (#4990)
* 2.x: Update marble diagrams for sample overloads * Add Maybe and switchIfEmpty diagrams
1 parent cd45675 commit a8ba158

File tree

3 files changed

+14
-10
lines changed

3 files changed

+14
-10
lines changed

src/main/java/io/reactivex/Flowable.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11611,7 +11611,7 @@ public final Flowable<T> sample(long period, TimeUnit unit) {
1161111611
* Returns a Flowable that emits the most recently emitted item (if any) emitted by the source Publisher
1161211612
* within periodic time intervals and optionally emit the very last upstream item when the upstream completes.
1161311613
* <p>
11614-
* <img width="640" height="305" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/sample.png" alt="">
11614+
* <img width="408" height="177" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/sample.emitlast.png" alt="">
1161511615
* <dl>
1161611616
* <dt><b>Backpressure:</b></dt>
1161711617
* <dd>This operator does not support backpressure as it uses time to control data flow.</dd>
@@ -11680,7 +11680,7 @@ public final Flowable<T> sample(long period, TimeUnit unit, Scheduler scheduler)
1168011680
* within periodic time intervals, where the intervals are defined on a particular Scheduler
1168111681
* and optionally emit the very last upstream item when the upstream completes.
1168211682
* <p>
11683-
* <img width="640" height="305" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/sample.s.png" alt="">
11683+
* <img width="408" height="177" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/sample.s.emitlast.png" alt="">
1168411684
* <dl>
1168511685
* <dt><b>Backpressure:</b></dt>
1168611686
* <dd>This operator does not support backpressure as it uses time to control data flow.</dd>
@@ -11720,7 +11720,7 @@ public final Flowable<T> sample(long period, TimeUnit unit, Scheduler scheduler,
1172011720
* emits the most recently emitted item (if any) emitted by the source Publisher since the previous
1172111721
* emission from the {@code sampler} Publisher.
1172211722
* <p>
11723-
* <img width="640" height="305" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/sample.o.png" alt="">
11723+
* <img width="437" height="198" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/sample.o.nolast.png" alt="">
1172411724
* <dl>
1172511725
* <dt><b>Backpressure:</b></dt>
1172611726
* <dd>This operator does not support backpressure as it uses the emissions of the {@code sampler}
@@ -11751,7 +11751,7 @@ public final <U> Flowable<T> sample(Publisher<U> sampler) {
1175111751
* emission from the {@code sampler} Publisher
1175211752
* and optionally emit the very last upstream item when the upstream or other Publisher complete.
1175311753
* <p>
11754-
* <img width="640" height="305" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/sample.o.png" alt="">
11754+
* <img width="437" height="198" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/sample.o.emitlast.png" alt="">
1175511755
* <dl>
1175611756
* <dt><b>Backpressure:</b></dt>
1175711757
* <dd>This operator does not support backpressure as it uses the emissions of the {@code sampler}
@@ -12877,6 +12877,7 @@ public final Flowable<T> subscribeOn(Scheduler scheduler) {
1287712877
/**
1287812878
* Returns a Flowable that emits the items emitted by the source Publisher or the items of an alternate
1287912879
* Publisher if the source Publisher is empty.
12880+
* <img width="410" height="164" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/switchifempty.png" alt="">
1288012881
* <p/>
1288112882
* <dl>
1288212883
* <dt><b>Backpressure:</b></dt>

src/main/java/io/reactivex/Maybe.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@
3535
/**
3636
* Represents a deferred computation and emission of a maybe value or exception.
3737
* <p>
38+
* <img width="403" height="233" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/maybe.png" alt="">
39+
* <p>
3840
* The main consumer type of Maybe is {@link MaybeObserver} whose methods are called
3941
* in a sequential fashion following this protocol:<br>
4042
* {@code onSubscribe (onSuccess | onError | onComplete)?}.
@@ -3768,6 +3770,8 @@ public final <E extends MaybeObserver<? super T>> E subscribeWith(E observer) {
37683770
/**
37693771
* Returns a Maybe that emits the items emitted by the source Maybe or the items of an alternate
37703772
* MaybeSource if the current Maybe is empty.
3773+
* <p>
3774+
* <img width="441" height="307" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/switchifempty.m.png" alt="">
37713775
* <p/>
37723776
* <dl>
37733777
* <dt><b>Scheduler:</b></dt>

src/main/java/io/reactivex/Observable.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9687,7 +9687,7 @@ public final Observable<T> sample(long period, TimeUnit unit) {
96879687
* Returns an Observable that emits the most recently emitted item (if any) emitted by the source ObservableSource
96889688
* within periodic time intervals and optionally emit the very last upstream item when the upstream completes.
96899689
* <p>
9690-
* <img width="640" height="305" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/sample.png" alt="">
9690+
* <img width="408" height="177" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/sample.emitlast.png" alt="">
96919691
* <dl>
96929692
* <dt><b>Scheduler:</b></dt>
96939693
* <dd>{@code sample} operates by default on the {@code computation} {@link Scheduler}.</dd>
@@ -9748,7 +9748,7 @@ public final Observable<T> sample(long period, TimeUnit unit, Scheduler schedule
97489748
* within periodic time intervals, where the intervals are defined on a particular Scheduler
97499749
* and optionally emit the very last upstream item when the upstream completes.
97509750
* <p>
9751-
* <img width="640" height="305" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/sample.s.png" alt="">
9751+
* <img width="408" height="177" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/sample.s.emitlast.png" alt="">
97529752
* <dl>
97539753
* <dt><b>Scheduler:</b></dt>
97549754
* <dd>You specify which {@link Scheduler} this operator will use</dd>
@@ -9784,9 +9784,8 @@ public final Observable<T> sample(long period, TimeUnit unit, Scheduler schedule
97849784
* emits the most recently emitted item (if any) emitted by the source ObservableSource since the previous
97859785
* emission from the {@code sampler} ObservableSource.
97869786
* <p>
9787-
* <img width="640" height="305" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/sample.o.png" alt="">
9787+
* <img width="437" height="198" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/sample.o.nolast.png" alt="">
97889788
* <dl>
9789-
* ObservableSource to control data flow.</dd>
97909789
* <dt><b>Scheduler:</b></dt>
97919790
* <dd>This version of {@code sample} does not operate by default on a particular {@link Scheduler}.</dd>
97929791
* </dl>
@@ -9811,9 +9810,8 @@ public final <U> Observable<T> sample(ObservableSource<U> sampler) {
98119810
* emission from the {@code sampler} ObservableSource
98129811
* and optionally emit the very last upstream item when the upstream or other ObservableSource complete.
98139812
* <p>
9814-
* <img width="640" height="305" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/sample.o.png" alt="">
9813+
* <img width="437" height="198" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/sample.o.emitlast.png" alt="">
98159814
* <dl>
9816-
* ObservableSource to control data flow.</dd>
98179815
* <dt><b>Scheduler:</b></dt>
98189816
* <dd>This version of {@code sample} does not operate by default on a particular {@link Scheduler}.</dd>
98199817
* </dl>
@@ -10766,6 +10764,7 @@ public final Observable<T> subscribeOn(Scheduler scheduler) {
1076610764
/**
1076710765
* Returns an Observable that emits the items emitted by the source ObservableSource or the items of an alternate
1076810766
* ObservableSource if the source ObservableSource is empty.
10767+
* <img width="410" height="164" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/switchifempty.png" alt="">
1076910768
* <p/>
1077010769
* <dl>
1077110770
* <dt><b>Scheduler:</b></dt>

0 commit comments

Comments
 (0)