Skip to content

3.x: Merge in changes from 2.x since the initial branching #6498

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

Merged
merged 1 commit into from
Jun 13, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -263,12 +263,10 @@ Flowable.range(1, 10)
```java
Flowable<Inventory> inventorySource = warehouse.getInventoryAsync();

inventorySource.flatMap(inventoryItem ->
erp.getDemandAsync(inventoryItem.getId())
.map(demand
-> System.out.println("Item " + inventoryItem.getName() + " has demand " + demand));
)
.subscribe();
inventorySource
.flatMap(inventoryItem -> erp.getDemandAsync(inventoryItem.getId())
.map(demand -> "Item " + inventoryItem.getName() + " has demand " + demand))
.subscribe(System.out::println);
```

### Continuations
Expand Down
4 changes: 2 additions & 2 deletions docs/Additional-Reading.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(A more complete and up-to-date list of resources can be found at the reactivex.io site: [[http://reactivex.io/tutorials.html]])
A more complete and up-to-date list of resources can be found at the [reactivex.io site](http://reactivex.io/tutorials.html)

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

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions docs/Creating-Observables.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ There exist overloads with 2 to 9 arguments for convenience, which objects (with
```java
Observable<Object> observable = Observable.just("1", "A", "3.2", "def");

observable.subscribe(item -> System.out.print(item), error -> error.printStackTrace,
() -> System.out.println());
observable.subscribe(item -> System.out.print(item), error -> error.printStackTrace(),
() -> System.out.println());
```

## From
Expand Down Expand Up @@ -80,7 +80,7 @@ for (int i = 0; i < array.length; i++) {
array[i] = i;
}

Observable<Integer> observable = Observable.fromIterable(array);
Observable<Integer> observable = Observable.fromArray(array);

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

```java
ScheduledExecutorService executor = Executors.newSingleThreadedScheduledExecutor();
ScheduledExecutorService executor = Executors.newSingleThreadScheduledExecutor();

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

Expand Down Expand Up @@ -298,10 +298,10 @@ String greeting = "Hello World!";

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

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

characters.subscribe(character -> System.out.print(character), erro -> error.printStackTrace(),
characters.subscribe(character -> System.out.print(character), error -> error.printStackTrace(),
() -> System.out.println());
```

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

error.subscribe(
v -> System.out.println("This should never be printed!"),
error -> error.printStackTrace(),
e -> e.printStackTrace(),
() -> System.out.println("This neither!"));
```

Expand All @@ -423,4 +423,4 @@ for (int i = 0; i < 10; i++) {
error -> error.printStackTrace(),
() -> System.out.println("Done"));
}
```
```
13 changes: 10 additions & 3 deletions src/main/java/io/reactivex/Completable.java
Original file line number Diff line number Diff line change
Expand Up @@ -508,6 +508,13 @@ public static <T> Completable fromMaybe(final MaybeSource<T> maybe) {
* <dl>
* <dt><b>Scheduler:</b></dt>
* <dd>{@code fromRunnable} does not operate by default on a particular {@link Scheduler}.</dd>
* <dt><b>Error handling:</b></dt>
* <dd> If the {@link Runnable} throws an exception, the respective {@link Throwable} is
* delivered to the downstream via {@link CompletableObserver#onError(Throwable)},
* except when the downstream has disposed this {@code Completable} source.
* In this latter case, the {@code Throwable} is delivered to the global error handler via
* {@link RxJavaPlugins#onError(Throwable)} as an {@link io.reactivex.exceptions.UndeliverableException UndeliverableException}.
* </dd>
* </dl>
* @param run the runnable to run for each subscriber
* @return the new Completable instance
Expand Down Expand Up @@ -2083,7 +2090,7 @@ public final Completable retry(BiPredicate<? super Integer, ? super Throwable> p
* <dt><b>Scheduler:</b></dt>
* <dd>{@code retry} does not operate by default on a particular {@link Scheduler}.</dd>
* </dl>
* @param times the number of times the returned Completable should retry this Completable
* @param times the number of times to resubscribe if the current Completable fails
* @return the new Completable instance
* @throws IllegalArgumentException if times is negative
*/
Expand All @@ -2103,7 +2110,7 @@ public final Completable retry(long times) {
* <dd>{@code retry} does not operate by default on a particular {@link Scheduler}.</dd>
* </dl>
* <p>History: 2.1.8 - experimental
* @param times the number of times the returned Completable should retry this Completable
* @param times the number of times to resubscribe if the current Completable fails
* @param predicate the predicate that is called with the latest throwable and should return
* true to indicate the returned Completable should resubscribe to this Completable.
* @return the new Completable instance
Expand Down Expand Up @@ -2292,7 +2299,7 @@ public final Disposable subscribe() {
@SchedulerSupport(SchedulerSupport.NONE)
@Override
public final void subscribe(CompletableObserver observer) {
ObjectHelper.requireNonNull(observer, "s is null");
ObjectHelper.requireNonNull(observer, "observer is null");
try {

observer = RxJavaPlugins.onSubscribe(this, observer);
Expand Down
Loading