File tree 2 files changed +18
-22
lines changed
src/main/java/io/reactivex
2 files changed +18
-22
lines changed Original file line number Diff line number Diff line change @@ -5472,20 +5472,18 @@ public final T blockingFirst(T defaultItem) {
5472
5472
}
5473
5473
5474
5474
/**
5475
- * Invokes a method on each item emitted by this {@code Flowable} and blocks until the Flowable
5476
- * completes.
5477
- * <p>
5478
- * <em>Note:</em> This will block even if the underlying Flowable is asynchronous.
5475
+ * Consumes the upstream {@code Flowable} in a blocking fashion and invokes the given
5476
+ * {@code Consumer} with each upstream item on the <em>current thread</em> until the
5477
+ * upstream terminates.
5479
5478
* <p>
5480
5479
* <img width="640" height="330" src="https://github.com/ReactiveX/RxJava/wiki/images/rx-operators/B.forEach.png" alt="">
5481
5480
* <p>
5482
- * This is similar to {@link Flowable#subscribe(Subscriber)}, but it blocks. Because it blocks it does not
5483
- * need the {@link Subscriber#onComplete()} or {@link Subscriber#onError(Throwable)} methods. If the
5484
- * underlying Flowable terminates with an error, rather than calling {@code onError}, this method will
5485
- * throw an exception.
5486
- *
5487
- * <p>The difference between this method and {@link #subscribe(Consumer)} is that the {@code onNext} action
5488
- * is executed on the emission thread instead of the current thread.
5481
+ * <em>Note:</em> the method will only return if the upstream terminates or the current
5482
+ * thread is interrupted.
5483
+ * <p>
5484
+ * <p>This method executes the {@code Consumer} on the current thread while
5485
+ * {@link #subscribe(Consumer)} executes the consumer on the original caller thread of the
5486
+ * sequence.
5489
5487
* <dl>
5490
5488
* <dt><b>Backpressure:</b></dt>
5491
5489
* <dd>The operator consumes the source {@code Flowable} in an unbounded manner
Original file line number Diff line number Diff line change @@ -5018,20 +5018,18 @@ public final T blockingFirst(T defaultItem) {
5018
5018
}
5019
5019
5020
5020
/**
5021
- * Invokes a method on each item emitted by this {@code Observable} and blocks until the Observable
5022
- * completes.
5023
- * <p>
5024
- * <em>Note:</em> This will block even if the underlying Observable is asynchronous.
5021
+ * Consumes the upstream {@code Observable} in a blocking fashion and invokes the given
5022
+ * {@code Consumer} with each upstream item on the <em>current thread</em> until the
5023
+ * upstream terminates.
5025
5024
* <p>
5026
5025
* <img width="640" height="330" src="https://github.com/ReactiveX/RxJava/wiki/images/rx-operators/blockingForEach.o.png" alt="">
5027
5026
* <p>
5028
- * This is similar to {@link Observable#subscribe(Observer)}, but it blocks. Because it blocks it does not
5029
- * need the {@link Observer#onComplete()} or {@link Observer#onError(Throwable)} methods. If the
5030
- * underlying Observable terminates with an error, rather than calling {@code onError}, this method will
5031
- * throw an exception.
5032
- *
5033
- * <p>The difference between this method and {@link #subscribe(Consumer)} is that the {@code onNext} action
5034
- * is executed on the emission thread instead of the current thread.
5027
+ * <em>Note:</em> the method will only return if the upstream terminates or the current
5028
+ * thread is interrupted.
5029
+ * <p>
5030
+ * <p>This method executes the {@code Consumer} on the current thread while
5031
+ * {@link #subscribe(Consumer)} executes the consumer on the original caller thread of the
5032
+ * sequence.
5035
5033
* <dl>
5036
5034
* <dt><b>Scheduler:</b></dt>
5037
5035
* <dd>{@code blockingForEach} does not operate by default on a particular {@link Scheduler}.</dd>
You can’t perform that action at this time.
0 commit comments