Skip to content
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

2.x: Use different wording on blockingForEach() JavaDocs #6057

Merged
merged 1 commit into from
Jun 21, 2018
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
20 changes: 9 additions & 11 deletions src/main/java/io/reactivex/Flowable.java
Original file line number Diff line number Diff line change
Expand Up @@ -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.
* <p>
* <em>Note:</em> 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 <em>current thread</em> until the
* upstream terminates.
* <p>
* <img width="640" height="330" src="https://github.com/ReactiveX/RxJava/wiki/images/rx-operators/B.forEach.png" alt="">
* <p>
* 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.
*
* <p>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.
* <em>Note:</em> the method will only return if the upstream terminates or the current
* thread is interrupted.
* <p>
* <p>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.
* <dl>
* <dt><b>Backpressure:</b></dt>
* <dd>The operator consumes the source {@code Flowable} in an unbounded manner
Expand Down
20 changes: 9 additions & 11 deletions src/main/java/io/reactivex/Observable.java
Original file line number Diff line number Diff line change
Expand Up @@ -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.
* <p>
* <em>Note:</em> 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 <em>current thread</em> until the
* upstream terminates.
* <p>
* <img width="640" height="330" src="https://github.com/ReactiveX/RxJava/wiki/images/rx-operators/blockingForEach.o.png" alt="">
* <p>
* 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.
*
* <p>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.
* <em>Note:</em> the method will only return if the upstream terminates or the current
* thread is interrupted.
* <p>
* <p>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.
* <dl>
* <dt><b>Scheduler:</b></dt>
* <dd>{@code blockingForEach} does not operate by default on a particular {@link Scheduler}.</dd>
Expand Down