Skip to content

Commit 609dd16

Browse files
committed
2.x: cleanup 9/12-1, more Maybe operators, more source code checking
1 parent ebec0b2 commit 609dd16

20 files changed

+1610
-155
lines changed

src/main/java/io/reactivex/Completable.java

Lines changed: 36 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,9 @@ public static Completable concat(Iterable<? extends CompletableSource> sources)
136136
/**
137137
* Returns a Completable which completes only when all sources complete, one after another.
138138
* <dl>
139+
* <dt><b>Backpressure:</b><dt>
140+
* <dd>The returned {@code Completable} honors the backpressure of the downstream consumer
141+
* and expects the other {@code Publisher} to honor it as well.</dd>
139142
* <dt><b>Scheduler:</b></dt>
140143
* <dd>{@code concat} does not operate by default on a particular {@link Scheduler}.</dd>
141144
* </dl>
@@ -152,6 +155,9 @@ public static Completable concat(Publisher<? extends CompletableSource> sources)
152155
/**
153156
* Returns a Completable which completes only when all sources complete, one after another.
154157
* <dl>
158+
* <dt><b>Backpressure:</b><dt>
159+
* <dd>The returned {@code Completable} honors the backpressure of the downstream consumer
160+
* and expects the other {@code Publisher} to honor it as well.</dd>
155161
* <dt><b>Scheduler:</b></dt>
156162
* <dd>{@code concat} does not operate by default on a particular {@link Scheduler}.</dd>
157163
* </dl>
@@ -197,9 +203,9 @@ public static Completable concat(Publisher<? extends CompletableSource> sources,
197203
* <dt><b>Scheduler:</b></dt>
198204
* <dd>{@code create} does not operate by default on a particular {@link Scheduler}.</dd>
199205
* </dl>
200-
* @param source the emitter that is called when a Subscriber subscribes to the returned {@code Flowable}
206+
* @param source the emitter that is called when a CompletableObserver subscribes to the returned {@code Completable}
201207
* @return the new Completable instance
202-
* @see FlowableOnSubscribe
208+
* @see CompletableOnSubscribe
203209
* @see Cancellable
204210
*/
205211
@SchedulerSupport(SchedulerSupport.NONE)
@@ -249,7 +255,7 @@ public static Completable defer(final Callable<? extends CompletableSource> comp
249255
* Creates a Completable which calls the given error supplier for each subscriber
250256
* and emits its returned Throwable.
251257
* <p>
252-
* If the errorSupplier returns null, the child CompletableSubscribers will receive a
258+
* If the errorSupplier returns null, the child CompletableObservers will receive a
253259
* NullPointerException.
254260
* <dl>
255261
* <dt><b>Scheduler:</b></dt>
@@ -354,6 +360,9 @@ public static <T> Completable fromObservable(final ObservableSource<T> observabl
354360
* Returns a Completable instance that subscribes to the given publisher, ignores all values and
355361
* emits only the terminal event.
356362
* <dl>
363+
* <dt><b>Backpressure:</b><dt>
364+
* <dd>The returned {@code Completable} honors the backpressure of the downstream consumer
365+
* and expects the other {@code Publisher} to honor it as well.</dd>
357366
* <dt><b>Scheduler:</b></dt>
358367
* <dd>{@code fromPublisher} does not operate by default on a particular {@link Scheduler}.</dd>
359368
* </dl>
@@ -431,6 +440,9 @@ public static Completable merge(Iterable<? extends CompletableSource> sources) {
431440
* Returns a Completable instance that subscribes to all sources at once and
432441
* completes only when all source Completables complete or one of them emits an error.
433442
* <dl>
443+
* <dt><b>Backpressure:</b><dt>
444+
* <dd>The returned {@code Completable} honors the backpressure of the downstream consumer
445+
* and expects the other {@code Publisher} to honor it as well.</dd>
434446
* <dt><b>Scheduler:</b></dt>
435447
* <dd>{@code merge} does not operate by default on a particular {@link Scheduler}.</dd>
436448
* </dl>
@@ -448,6 +460,9 @@ public static Completable merge(Publisher<? extends CompletableSource> sources)
448460
* Returns a Completable instance that keeps subscriptions to a limited number of sources at once and
449461
* completes only when all source Completables complete or one of them emits an error.
450462
* <dl>
463+
* <dt><b>Backpressure:</b><dt>
464+
* <dd>The returned {@code Completable} honors the backpressure of the downstream consumer
465+
* and expects the other {@code Publisher} to honor it as well.</dd>
451466
* <dt><b>Scheduler:</b></dt>
452467
* <dd>{@code merge} does not operate by default on a particular {@link Scheduler}.</dd>
453468
* </dl>
@@ -468,6 +483,9 @@ public static Completable merge(Publisher<? extends CompletableSource> sources,
468483
* completes only when all source Completables terminate in one way or another, combining any exceptions
469484
* thrown by either the sources Observable or the inner Completable instances.
470485
* <dl>
486+
* <dt><b>Backpressure:</b><dt>
487+
* <dd>The returned {@code Flowable} honors the backpressure of the downstream consumer
488+
* and expects the other {@code Publisher} to honor it as well.
471489
* <dt><b>Scheduler:</b></dt>
472490
* <dd>{@code merge0} does not operate by default on a particular {@link Scheduler}.</dd>
473491
* </dl>
@@ -528,6 +546,9 @@ public static Completable mergeDelayError(Iterable<? extends CompletableSource>
528546
* any error emitted by either the sources observable or any of the inner Completables until all of
529547
* them terminate in a way or another.
530548
* <dl>
549+
* <dt><b>Backpressure:</b><dt>
550+
* <dd>The returned {@code Completable} honors the backpressure of the downstream consumer
551+
* and expects the other {@code Publisher} to honor it as well.</dd>
531552
* <dt><b>Scheduler:</b></dt>
532553
* <dd>{@code mergeDelayError} does not operate by default on a particular {@link Scheduler}.</dd>
533554
* </dl>
@@ -547,6 +568,9 @@ public static Completable mergeDelayError(Publisher<? extends CompletableSource>
547568
* observable or any of the inner Completables until all of
548569
* them terminate in a way or another.
549570
* <dl>
571+
* <dt><b>Backpressure:</b><dt>
572+
* <dd>The returned {@code Completable} honors the backpressure of the downstream consumer
573+
* and expects the other {@code Publisher} to honor it as well.</dd>
550574
* <dt><b>Scheduler:</b></dt>
551575
* <dd>{@code mergeDelayError} does not operate by default on a particular {@link Scheduler}.</dd>
552576
* </dl>
@@ -732,11 +756,14 @@ public final <T> Observable<T> andThen(ObservableSource<T> next) {
732756
}
733757

734758
/**
735-
* Returns an Flowable which will subscribe to this Completable and once that is completed then
759+
* Returns a Flowable which will subscribe to this Completable and once that is completed then
736760
* will subscribe to the {@code next} Flowable. An error event from this Completable will be
737761
* propagated to the downstream subscriber and will result in skipping the subscription of the
738762
* Observable.
739763
* <dl>
764+
* <dt><b>Backpressure:</b><dt>
765+
* <dd>The returned {@code Flowable} honors the backpressure of the downstream consumer
766+
* and expects the other {@code Publisher} to honor it as well.
740767
* <dt><b>Scheduler:</b></dt>
741768
* <dd>{@code andThen} does not operate by default on a particular {@link Scheduler}.</dd>
742769
* </dl>
@@ -1387,6 +1414,9 @@ public final <T> Observable<T> startWith(Observable<T> other) {
13871414
* Returns an Observable which first delivers the events
13881415
* of the other Observable then runs this Completable.
13891416
* <dl>
1417+
* <dt><b>Backpressure:</b><dt>
1418+
* <dd>The returned {@code Flowable} honors the backpressure of the downstream consumer
1419+
* and expects the other {@code Publisher} to honor it as well.
13901420
* <dt><b>Scheduler:</b></dt>
13911421
* <dd>{@code startWith} does not operate by default on a particular {@link Scheduler}.</dd>
13921422
* </dl>
@@ -1659,6 +1689,8 @@ public final <U> U to(Function<? super Completable, U> converter) {
16591689
* Returns an Observable which when subscribed to subscribes to this Completable and
16601690
* relays the terminal events to the subscriber.
16611691
* <dl>
1692+
* <dt><b>Backpressure:</b><dt>
1693+
* <dd>The returned {@code Flowable} honors the backpressure of the downstream consumer.
16621694
* <dt><b>Scheduler:</b></dt>
16631695
* <dd>{@code toFlowable} does not operate by default on a particular {@link Scheduler}.</dd>
16641696
* </dl>

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

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ public static <T, R> Flowable<R> combineLatestDelayError(Function<? super Object
408408

409409
/**
410410
* Combines a collection of source Publishers by emitting an item that aggregates the latest values of each of
411-
* the source ObservableSources each time an item is received from any of the source Publisher, where this
411+
* the source Publishers each time an item is received from any of the source Publisher, where this
412412
* aggregation is defined by a specified function and delays any error from the sources until
413413
* all source Publishers terminate.
414414
* <p>
@@ -1274,7 +1274,7 @@ public static <T> Flowable<T> concatArrayDelayError(Publisher<? extends T>... so
12741274
* in order, each one after the previous one completes.
12751275
* <dl>
12761276
* <dt><b>Backpressure:</b></dt>
1277-
* <dd><dd>The operator honors backpressure from downstream. The {@code Publisher}
1277+
* <dd>The operator honors backpressure from downstream. The {@code Publisher}
12781278
* sources are expected to honor backpressure as well.
12791279
* If any of the source {@code Publisher}s violate this, the operator will signal a
12801280
* {@code MissingBackpressureException}.</dd>
@@ -1300,7 +1300,7 @@ public static <T> Flowable<T> concatArrayEager(Publisher<? extends T>... sources
13001300
* in order, each one after the previous one completes.
13011301
* <dl>
13021302
* <dt><b>Backpressure:</b></dt>
1303-
* <dd><dd>The operator honors backpressure from downstream. The {@code Publisher}
1303+
* <dd>The operator honors backpressure from downstream. The {@code Publisher}
13041304
* sources are expected to honor backpressure as well.
13051305
* If any of the source {@code Publisher}s violate this, the operator will signal a
13061306
* {@code MissingBackpressureException}.</dd>
@@ -1702,12 +1702,12 @@ public static <T> Flowable<T> fromArray(T... items) {
17021702
}
17031703

17041704
/**
1705-
* Returns a Flowable that, when an Subscriber subscribes to it, invokes a function you specify and then
1705+
* Returns a Flowable that, when a Subscriber subscribes to it, invokes a function you specify and then
17061706
* emits the value returned from that function.
17071707
* <p>
17081708
* <img width="640" height="195" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/fromCallable.png" alt="">
17091709
* <p>
1710-
* This allows you to defer the execution of the function you specify until an Subscriber subscribes to the
1710+
* This allows you to defer the execution of the function you specify until a Subscriber subscribes to the
17111711
* Publisher. That is to say, it makes the function "lazy."
17121712
* <dl>
17131713
* <dt><b>Backpressure:</b></dt>
@@ -1718,7 +1718,7 @@ public static <T> Flowable<T> fromArray(T... items) {
17181718
*
17191719
* @param supplier
17201720
* a function, the execution of which should be deferred; {@code fromCallable} will invoke this
1721-
* function only when an Subscriber subscribes to the Publisher that {@code fromCallable} returns
1721+
* function only when a Subscriber subscribes to the Publisher that {@code fromCallable} returns
17221722
* @param <T>
17231723
* the type of the item emitted by the Publisher
17241724
* @return a Flowable whose {@link Subscriber}s' subscriptions trigger an invocation of the given function
@@ -2151,7 +2151,7 @@ public static Flowable<Long> interval(long initialDelay, long period, TimeUnit u
21512151
* <dl>
21522152
* <dt><b>Backpressure:</b></dt>
21532153
* <dd>The operator signals a {@code MissingBackpressureException} if the downstream
2154-
* is not ready to receive the next value.
2154+
* is not ready to receive the next value.</dd>
21552155
* <dt><b>Scheduler:</b></dt>
21562156
* <dd>{@code interval} operates by default on the {@code computation} {@link Scheduler}.</dd>
21572157
* </dl>
@@ -3007,7 +3007,7 @@ public static <T> Flowable<T> merge(
30073007
}
30083008

30093009
/**
3010-
* Flattens an Iterable of Publishers into one Publisher, in a way that allows an Subscriber to receive all
3010+
* Flattens an Iterable of Publishers into one Publisher, in a way that allows a Subscriber to receive all
30113011
* successfully emitted items from each of the source Publishers without being interrupted by an error
30123012
* notification from one of them.
30133013
* <p>
@@ -3043,7 +3043,7 @@ public static <T> Flowable<T> mergeDelayError(Iterable<? extends Publisher<? ext
30433043

30443044

30453045
/**
3046-
* Flattens an Iterable of Publishers into one Publisher, in a way that allows an Subscriber to receive all
3046+
* Flattens an Iterable of Publishers into one Publisher, in a way that allows a Subscriber to receive all
30473047
* successfully emitted items from each of the source Publishers without being interrupted by an error
30483048
* notification from one of them, while limiting the number of concurrent subscriptions to these Publishers.
30493049
* <p>
@@ -3082,7 +3082,7 @@ public static <T> Flowable<T> mergeDelayError(Iterable<? extends Publisher<? ext
30823082
}
30833083

30843084
/**
3085-
* Flattens an array of Publishers into one Publisher, in a way that allows an Subscriber to receive all
3085+
* Flattens an array of Publishers into one Publisher, in a way that allows a Subscriber to receive all
30863086
* successfully emitted items from each of the source Publishers without being interrupted by an error
30873087
* notification from one of them, while limiting the number of concurrent subscriptions to these Publishers.
30883088
* <p>
@@ -3121,7 +3121,7 @@ public static <T> Flowable<T> mergeArrayDelayError(int maxConcurrency, int buffe
31213121
}
31223122

31233123
/**
3124-
* Flattens an Iterable of Publishers into one Publisher, in a way that allows an Subscriber to receive all
3124+
* Flattens an Iterable of Publishers into one Publisher, in a way that allows a Subscriber to receive all
31253125
* successfully emitted items from each of the source Publishers without being interrupted by an error
31263126
* notification from one of them, while limiting the number of concurrent subscriptions to these Publishers.
31273127
* <p>
@@ -3158,7 +3158,7 @@ public static <T> Flowable<T> mergeDelayError(Iterable<? extends Publisher<? ext
31583158
}
31593159

31603160
/**
3161-
* Flattens a Publisher that emits Publishers into one Publisher, in a way that allows an Subscriber to
3161+
* Flattens a Publisher that emits Publishers into one Publisher, in a way that allows a Subscriber to
31623162
* receive all successfully emitted items from all of the source Publishers without being interrupted by
31633163
* an error notification from one of them.
31643164
* <p>
@@ -3193,7 +3193,7 @@ public static <T> Flowable<T> mergeDelayError(Publisher<? extends Publisher<? ex
31933193
}
31943194

31953195
/**
3196-
* Flattens a Publisher that emits Publishers into one Publisher, in a way that allows an Subscriber to
3196+
* Flattens a Publisher that emits Publishers into one Publisher, in a way that allows a Subscriber to
31973197
* receive all successfully emitted items from all of the source Publishers without being interrupted by
31983198
* an error notification from one of them, while limiting the
31993199
* number of concurrent subscriptions to these Publishers.
@@ -3232,7 +3232,7 @@ public static <T> Flowable<T> mergeDelayError(Publisher<? extends Publisher<? ex
32323232
}
32333233

32343234
/**
3235-
* Flattens an array of Publishers into one Flowable, in a way that allows an Subscriber to receive all
3235+
* Flattens an array of Publishers into one Flowable, in a way that allows a Subscriber to receive all
32363236
* successfully emitted items from each of the source Publishers without being interrupted by an error
32373237
* notification from one of them.
32383238
* <p>
@@ -3267,7 +3267,7 @@ public static <T> Flowable<T> mergeArrayDelayError(Publisher<? extends T>... sou
32673267
}
32683268

32693269
/**
3270-
* Flattens two Publishers into one Publisher, in a way that allows an Subscriber to receive all
3270+
* Flattens two Publishers into one Publisher, in a way that allows a Subscriber to receive all
32713271
* successfully emitted items from each of the source Publishers without being interrupted by an error
32723272
* notification from one of them.
32733273
* <p>
@@ -3305,7 +3305,7 @@ public static <T> Flowable<T> mergeDelayError(Publisher<? extends T> source1, Pu
33053305
}
33063306

33073307
/**
3308-
* Flattens three Publishers into one Publisher, in a way that allows an Subscriber to receive all
3308+
* Flattens three Publishers into one Publisher, in a way that allows a Subscriber to receive all
33093309
* successfully emitted items from all of the source Publishers without being interrupted by an error
33103310
* notification from one of them.
33113311
* <p>
@@ -3348,7 +3348,7 @@ public static <T> Flowable<T> mergeDelayError(Publisher<? extends T> source1, Pu
33483348

33493349

33503350
/**
3351-
* Flattens four Publishers into one Publisher, in a way that allows an Subscriber to receive all
3351+
* Flattens four Publishers into one Publisher, in a way that allows a Subscriber to receive all
33523352
* successfully emitted items from all of the source Publishers without being interrupted by an error
33533353
* notification from one of them.
33543354
* <p>

0 commit comments

Comments
 (0)