From 23aa4525e6eaf2d3e1e983e48fbc12176f2a140b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A1vid=20Karnok?= Date: Thu, 21 Jun 2018 23:04:50 +0200 Subject: [PATCH] 2.x: Use different wording on blockingForEach() JavaDocs --- src/main/java/io/reactivex/Flowable.java | 20 +++++++++----------- src/main/java/io/reactivex/Observable.java | 20 +++++++++----------- 2 files changed, 18 insertions(+), 22 deletions(-) diff --git a/src/main/java/io/reactivex/Flowable.java b/src/main/java/io/reactivex/Flowable.java index 13853d4603..406198507c 100644 --- a/src/main/java/io/reactivex/Flowable.java +++ b/src/main/java/io/reactivex/Flowable.java @@ -5472,20 +5472,18 @@ public final T blockingFirst(T defaultItem) { } /** - * Invokes a method on each item emitted by this {@code Flowable} and blocks until the Flowable - * completes. - *

- * Note: This will block even if the underlying Flowable is asynchronous. + * Consumes the upstream {@code Flowable} in a blocking fashion and invokes the given + * {@code Consumer} with each upstream item on the current thread until the + * upstream terminates. *

* *

- * This is similar to {@link Flowable#subscribe(Subscriber)}, but it blocks. Because it blocks it does not - * need the {@link Subscriber#onComplete()} or {@link Subscriber#onError(Throwable)} methods. If the - * underlying Flowable terminates with an error, rather than calling {@code onError}, this method will - * throw an exception. - * - *

The difference between this method and {@link #subscribe(Consumer)} is that the {@code onNext} action - * is executed on the emission thread instead of the current thread. + * Note: the method will only return if the upstream terminates or the current + * thread is interrupted. + *

+ *

This method executes the {@code Consumer} on the current thread while + * {@link #subscribe(Consumer)} executes the consumer on the original caller thread of the + * sequence. *

*
Backpressure:
*
The operator consumes the source {@code Flowable} in an unbounded manner diff --git a/src/main/java/io/reactivex/Observable.java b/src/main/java/io/reactivex/Observable.java index feddca1fed..045fe3d987 100644 --- a/src/main/java/io/reactivex/Observable.java +++ b/src/main/java/io/reactivex/Observable.java @@ -5018,20 +5018,18 @@ public final T blockingFirst(T defaultItem) { } /** - * Invokes a method on each item emitted by this {@code Observable} and blocks until the Observable - * completes. - *

- * Note: This will block even if the underlying Observable is asynchronous. + * Consumes the upstream {@code Observable} in a blocking fashion and invokes the given + * {@code Consumer} with each upstream item on the current thread until the + * upstream terminates. *

* *

- * This is similar to {@link Observable#subscribe(Observer)}, but it blocks. Because it blocks it does not - * need the {@link Observer#onComplete()} or {@link Observer#onError(Throwable)} methods. If the - * underlying Observable terminates with an error, rather than calling {@code onError}, this method will - * throw an exception. - * - *

The difference between this method and {@link #subscribe(Consumer)} is that the {@code onNext} action - * is executed on the emission thread instead of the current thread. + * Note: the method will only return if the upstream terminates or the current + * thread is interrupted. + *

+ *

This method executes the {@code Consumer} on the current thread while + * {@link #subscribe(Consumer)} executes the consumer on the original caller thread of the + * sequence. *

*
Scheduler:
*
{@code blockingForEach} does not operate by default on a particular {@link Scheduler}.