Skip to content

Commit b95e3dc

Browse files
authored
3.x: Merge in changes from 2.x since the initial branching (#6498)
1 parent 837ca6b commit b95e3dc

26 files changed

+599
-516
lines changed

README.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -263,12 +263,10 @@ Flowable.range(1, 10)
263263
```java
264264
Flowable<Inventory> inventorySource = warehouse.getInventoryAsync();
265265

266-
inventorySource.flatMap(inventoryItem ->
267-
erp.getDemandAsync(inventoryItem.getId())
268-
.map(demand
269-
-> System.out.println("Item " + inventoryItem.getName() + " has demand " + demand));
270-
)
271-
.subscribe();
266+
inventorySource
267+
.flatMap(inventoryItem -> erp.getDemandAsync(inventoryItem.getId())
268+
.map(demand -> "Item " + inventoryItem.getName() + " has demand " + demand))
269+
.subscribe(System.out::println);
272270
```
273271

274272
### Continuations

docs/Additional-Reading.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
(A more complete and up-to-date list of resources can be found at the reactivex.io site: [[http://reactivex.io/tutorials.html]])
1+
A more complete and up-to-date list of resources can be found at the [reactivex.io site](http://reactivex.io/tutorials.html)
22

33
# Introducing Reactive Programming
44
* [Introduction to Rx](http://www.introtorx.com/): a free, on-line book by Lee Campbell **(1.x)**
@@ -10,7 +10,7 @@
1010
* [Your Mouse is a Database](http://queue.acm.org/detail.cfm?id=2169076) by Erik Meijer
1111
* [A Playful Introduction to Rx](https://www.youtube.com/watch?v=WKore-AkisY) a video lecture by Erik Meijer
1212
* Wikipedia: [Reactive Programming](http://en.wikipedia.org/wiki/Reactive_programming) and [Functional Reactive Programming](http://en.wikipedia.org/wiki/Functional_reactive_programming)
13-
* [What is Reactive Programming?](http://blog.hackhands.com/overview-of-reactive-programming/) a video presentation by Jafar Husain.
13+
* [What is Reactive Programming?](https://www.youtube.com/watch?v=-8Y1-lE6NSA) a video presentation by Jafar Husain.
1414
* [2 minute introduction to Rx](https://medium.com/@andrestaltz/2-minute-introduction-to-rx-24c8ca793877) by André Staltz
1515
* StackOverflow: [What is (functional) reactive programming?](http://stackoverflow.com/a/1030631/1946802)
1616
* [The Reactive Manifesto](http://www.reactivemanifesto.org/)

docs/Alphabetical-List-of-Observable-Operators.md

Lines changed: 248 additions & 248 deletions
Large diffs are not rendered by default.

docs/Creating-Observables.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ There exist overloads with 2 to 9 arguments for convenience, which objects (with
3737
```java
3838
Observable<Object> observable = Observable.just("1", "A", "3.2", "def");
3939

40-
observable.subscribe(item -> System.out.print(item), error -> error.printStackTrace,
41-
() -> System.out.println());
40+
observable.subscribe(item -> System.out.print(item), error -> error.printStackTrace(),
41+
() -> System.out.println());
4242
```
4343

4444
## From
@@ -80,7 +80,7 @@ for (int i = 0; i < array.length; i++) {
8080
array[i] = i;
8181
}
8282

83-
Observable<Integer> observable = Observable.fromIterable(array);
83+
Observable<Integer> observable = Observable.fromArray(array);
8484

8585
observable.subscribe(item -> System.out.println(item), error -> error.printStackTrace(),
8686
() -> System.out.println("Done"));
@@ -155,7 +155,7 @@ Given a pre-existing, already running or already completed `java.util.concurrent
155155
#### fromFuture example:
156156

157157
```java
158-
ScheduledExecutorService executor = Executors.newSingleThreadedScheduledExecutor();
158+
ScheduledExecutorService executor = Executors.newSingleThreadScheduledExecutor();
159159

160160
Future<String> future = executor.schedule(() -> "Hello world!", 1, TimeUnit.SECONDS);
161161

@@ -298,10 +298,10 @@ String greeting = "Hello World!";
298298

299299
Observable<Integer> indexes = Observable.range(0, greeting.length());
300300

301-
Observable<Char> characters = indexes
301+
Observable<Character> characters = indexes
302302
.map(index -> greeting.charAt(index));
303303

304-
characters.subscribe(character -> System.out.print(character), erro -> error.printStackTrace(),
304+
characters.subscribe(character -> System.out.print(character), error -> error.printStackTrace(),
305305
() -> System.out.println());
306306
```
307307

@@ -396,7 +396,7 @@ Observable<String> error = Observable.error(new IOException());
396396

397397
error.subscribe(
398398
v -> System.out.println("This should never be printed!"),
399-
error -> error.printStackTrace(),
399+
e -> e.printStackTrace(),
400400
() -> System.out.println("This neither!"));
401401
```
402402

@@ -423,4 +423,4 @@ for (int i = 0; i < 10; i++) {
423423
error -> error.printStackTrace(),
424424
() -> System.out.println("Done"));
425425
}
426-
```
426+
```

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

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -508,6 +508,13 @@ public static <T> Completable fromMaybe(final MaybeSource<T> maybe) {
508508
* <dl>
509509
* <dt><b>Scheduler:</b></dt>
510510
* <dd>{@code fromRunnable} does not operate by default on a particular {@link Scheduler}.</dd>
511+
* <dt><b>Error handling:</b></dt>
512+
* <dd> If the {@link Runnable} throws an exception, the respective {@link Throwable} is
513+
* delivered to the downstream via {@link CompletableObserver#onError(Throwable)},
514+
* except when the downstream has disposed this {@code Completable} source.
515+
* In this latter case, the {@code Throwable} is delivered to the global error handler via
516+
* {@link RxJavaPlugins#onError(Throwable)} as an {@link io.reactivex.exceptions.UndeliverableException UndeliverableException}.
517+
* </dd>
511518
* </dl>
512519
* @param run the runnable to run for each subscriber
513520
* @return the new Completable instance
@@ -2083,7 +2090,7 @@ public final Completable retry(BiPredicate<? super Integer, ? super Throwable> p
20832090
* <dt><b>Scheduler:</b></dt>
20842091
* <dd>{@code retry} does not operate by default on a particular {@link Scheduler}.</dd>
20852092
* </dl>
2086-
* @param times the number of times the returned Completable should retry this Completable
2093+
* @param times the number of times to resubscribe if the current Completable fails
20872094
* @return the new Completable instance
20882095
* @throws IllegalArgumentException if times is negative
20892096
*/
@@ -2103,7 +2110,7 @@ public final Completable retry(long times) {
21032110
* <dd>{@code retry} does not operate by default on a particular {@link Scheduler}.</dd>
21042111
* </dl>
21052112
* <p>History: 2.1.8 - experimental
2106-
* @param times the number of times the returned Completable should retry this Completable
2113+
* @param times the number of times to resubscribe if the current Completable fails
21072114
* @param predicate the predicate that is called with the latest throwable and should return
21082115
* true to indicate the returned Completable should resubscribe to this Completable.
21092116
* @return the new Completable instance
@@ -2292,7 +2299,7 @@ public final Disposable subscribe() {
22922299
@SchedulerSupport(SchedulerSupport.NONE)
22932300
@Override
22942301
public final void subscribe(CompletableObserver observer) {
2295-
ObjectHelper.requireNonNull(observer, "s is null");
2302+
ObjectHelper.requireNonNull(observer, "observer is null");
22962303
try {
22972304

22982305
observer = RxJavaPlugins.onSubscribe(this, observer);

0 commit comments

Comments
 (0)